Are these OpenAPI 3 paths ambiguous?
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Documentação
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- openapi
- Domínio
- api, documentation
Direção de pesquisa
Leia a seção Paths Object em versions/3.0.0.md e compare suas regras de correspondência com os exemplos /shops/{shopId}/pets/{petId} e /shops/{shopId}/pets/_search nesta issue. Revise a discussão existente antes de decidir se o texto precisa de uma definição ou de um exemplo adicional. Considera-se concluído quando os maintainers concordarem com uma redação esclarecida da especificação e a seção relevante for atualizada.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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}
- Linguagem predominante
- Markdown
- Estrelas
- 31.2k
- Forks
- 9.2k
- Merge médio
- 2d 9h
- PRs com merge (30d)
- 17
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de OAI/OpenAPI-Specification
-
Housekeeping
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 45/100
OAI/OpenAPI-Specification#5566 ·
Mantenedores costumam responder em até 1 dia
-
Housekeeping
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 35/100
OAI/OpenAPI-Specification#5562 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Housekeeping
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 10/100
OAI/OpenAPI-Specification#5556 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
v3.2.1 releaseTalvez livre de novo @lornajane assumiu há 33 dias e não há nenhum pull request aberto. Aberta
OAI/OpenAPI-Specification#5460 · 11 comentários · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
param serialization
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
OAI/OpenAPI-Specification#5366 · 12 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de OAI/OpenAPI-Specification
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 comentário ·
Mantenedores costumam responder em até 3 dias
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
FujiNetWIFI/fujinet-lib#122 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
effort: low prio: low ready
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
digitalfabrik/integreat-cms#4616 ·
Mantenedores costumam responder em até 5 dias
-
[BUG] Cloudflare KV binding 模式下 kvDriver.list() 沿用 EdgeOne 语义,字段名不匹配导致 key 格式下初始化 500 并耗尽 list 配额Talvez já em andamento @wumingzhinu assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
OpenListTeam/OpenList-Worker#125 ·
Mantenedores costumam responder em até 2 dias
-
refactor topic-map
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia