Are these OpenAPI 3 paths ambiguous?
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Documentation
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- openapi
- Domaine
- api, documentation
Piste de recherche
Lisez la section Paths Object dans versions/3.0.0.md et comparez ses règles de correspondance avec les exemples /shops/{shopId}/pets/{petId} et /shops/{shopId}/pets/_search de cette issue. Consultez la discussion existante avant de décider si le texte nécessite une définition ou un exemple supplémentaire. Le travail est considéré comme terminé lorsque les maintainers approuvent une formulation clarifiée de la spécification et que la section concernée est mise à jour.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
As suggested by @MikeRalphson on Stackoverflow, I'm asking the question here as well.
Are those OpenAPI 3 paths ambiguous?
/shops/{shopId}/pets/{petId}
/shops/{shopId}/pets/_search
I want to answer no but, strictly reading the spec, I can't decide because they seem to fall into none of the 3 statements made by the spec:
- Neither path is concrete (term used in the spec)
- Paths don't seem to meet the Templated paths with the same hierarchy but different templated names criteria (that is not very clear to me, here is my understanding:
"/shops/{}/pets/{}" != "/shops/{}/pets/_search") - Paths do not look like the ambiguous example
In addition to the question asked on Stackoverflow, let me ask two additional questions (below).
Should the OA3 spec be improved?
@MikeRalphson's reading of the spec: path are not ambiguous because one is more concrete than the other.
If paths are indeed not ambiguous, then the more concrete notion might need to be defined.
How could the OA3 spec be improved?
We might add an example like this:
Assuming paths sharing a common and identical prefix,
/shops/{shopId}/pets, the more concrete definition,/shops/{shopId}/pets/_search, will be matched first if used:/shops/{shopId}/pets/{petId} /shops/{shopId}/pets/_search
Or we might only show minimalistic examples involving templated names, and say that they also apply in case of common and identical prefixes:
First statement (concrete vs template case):
/{otherPlace} /here
Second statement (considered identical and invalid):
/{id} /{name}
Third statement is left unchanged (ambiguous resolution):
/{entity}/me /books/{id}
Related excerpt of the OA3 spec
The "Paths object" paragraph of the OpenAPI 3 specification (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#paths-object) is stating (3 sentences, 3 statements):
When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
Those 3 statements are followed by 3 examples (and that's it):
Assuming the following paths, the concrete definition,
/pets/mine, will be matched first if used:/pets/{petId} /pets/mineThe following paths are considered identical and invalid:
/pets/{petId} /pets/{name}The following may lead to ambiguous resolution:
/{entity}/me /books/{id}
- Langage dominant
- Markdown
- Étoiles
- 31.2k
- Forks
- 9.2k
- Merge moyen
- 2 j 9 h
- PR mergées (30 j)
- 17
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de OAI/OpenAPI-Specification
-
Housekeeping
Difficulté 1/5 Moins d'une heure Accessibilité débutants 45/100
OAI/OpenAPI-Specification#5566 ·
Les mainteneurs répondent en général sous 1 jour
-
Housekeeping
Difficulté 1/5 Moins d'une heure Accessibilité débutants 35/100
OAI/OpenAPI-Specification#5562 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Housekeeping
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 10/100
OAI/OpenAPI-Specification#5556 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
v3.2.1 releasePeut-être à nouveau libre @lornajane l’a pris il y a 32 jours, et aucune pull request n’est ouverte. Ouverte
OAI/OpenAPI-Specification#5460 · 11 commentaires · 1 réaction · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
param serialization
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
OAI/OpenAPI-Specification#5366 · 12 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de OAI/OpenAPI-Specification
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
[BUG] Re-subscribing the Mono returned by listTools/listResources/listResourceTemplates/listPrompts/listRoots duplicates the resultsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
modelcontextprotocol/java-sdk#1174 · 1 réaction ·
Les mainteneurs répondent en général sous 2 jours
-
[BUG] 运行位置的分支列表不自动刷新,外部新建的分支看不到Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
NanmiCoder/cc-haha#1533 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Remove song from playlistOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
maxrave-dev/SimpMusic#2649 ·
Les mainteneurs répondent en général sous 2 jours
-
product/backlog
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
TencentBlueKing/bk-nodemgr#3645 ·
Les mainteneurs répondent en général sous 1 jour