v3.3: Global parameters
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
- 30/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- openapi
- Domínio
- api, documentation
Direção de pesquisa
Leia primeiro a discussão #5314 e, em seguida, revise as regras de parâmetros do OpenAPI 3.3 descritas nesta issue. Considera-se concluído quando for decidido se um campo parameters global deve ser adicionado e o comportamento escolhido para os parâmetros path, querystring, header, query e cookie tiver sido registrado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
I'm breaking this out from discussion #5314 which covers allowing various fields at multiple levels.
This issue is to consider the implementation challenges of a global (OpenAPI Object in the entry document) parameters field, and ultiimately decide whether to add such a field.
TL;DR:
in: path— keep the existing mandatoryrequired: trueand make it an error any time anin: pathparameter does not match a path template variable; this limits the utility of globalin: pathparameters, but that's finein: querystring— this can only be used once per operation, so setting it globally is unlikely to be useful, but we needn't forbid it; this is probably rarely used even at the Path Item level for the same reasonin: header— it's already possible to specify headers at the Path Item level that don't make sense for every operation, so it doesn't matter if it's also possible at the global level; we don't worry about it now, and we don't need to start worrying about it
I can't think of any concerns with in: query or in: cookie parameters that don't already exist with the Path Item plus Operation levels.
More details and options below for those interested:
global in: path parameters
Use case: Every item path template looks like /foo/{id}, so there is a desire to specify the id path parameter globally.
Problem: Not every path template is an item template, and in: path parameters MUST state required: true
- If other path templates have an
idpath parameter with different syntax or semantics, then defining one globally is just a user error, and we need not concern ourselves with it. - If (as is likely), some path templates don't have an
idpath parameter at all, what happens?- If it is an error (retaining the
required: truerequirement), we are making a useful use case impossible. - If we allow
required: falseon path parameters, we could say that that means that it can be ignored if there is no matching path template variable; however this behavior is more complex and no longer just adding another level
- If it is an error (retaining the
My thought is that for 3.3, we retain required: true, so ending up with an in: path parameter that does not match a path template variable is always an error. This is the simplest option, and we can add more functionality in a future release if there is strong enough demand.
global in: querystring parameters
Since you can't have two of these on the same operation, regardless of where they were defined, nor can you combine them with any in: query parameters, this will probably not be used globally. And probably isn't often used at the Path Item level.
This restriction mostly exists to keep request matching complexity to a manageable level. Note that there is a weird exception in that an API Key query parameter presumably gets tacked on regardless, as we don't address it. We should probably clarify that.
My thought for 3.3 is to not do anything special about this. No one has complained about it AFAIK, so let's keep going. API Keys are a SAF and by definition cause exceptions to normal rules, so it being an exception already is fine.
global in: header parameters
Similarly, some request headers are broadly but not universally useful. However, unlike path template variables, there is no required: true requirement.
Specifying an irrelevant header parameter is possible now, and we don't worry about it. For example:
/foos:
parameters:
- in: header
name: Prefer
schema:
type: string
pattern: ^return=(minimal|representation)
get: {...}
post: {...}
Applying this preference to the GET request doesn't really make sense, as GET by definition returns the representation. A return=minimal GET request would effectively be a HEAD request.
And for that matter, as written above, the Prefer header parameter would apply to a HEAD operation (even though none is explicitly described), which also doesn't make any sense.
My thought for 3.3 is that we don't worry about this now, and I suggest we continue to not worry about it. It might not make sense, but irrelevant HTTP fields are generally silently ignored, so even if someone sent this field (and note that it is not required), it is unlikely it would cause a problem.
- 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 · 2 comentários ·
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á 34 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 72/100
Mantenedores costumam responder em até 1 dia
-
bug pkg: sphinx-needs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
useblocks/sphinx-needs#2249 ·
Mantenedores costumam responder em até 1 dia
-
Channels status: needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
mastra-ai/mastra#27093 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
code-yeongyu/senpi#3350 ·
Mantenedores costumam responder em até 1 dia
-
ai_p1 comp-filesystem-cache
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ClickHouse/ClickHouse#125860 ·
Mantenedores costumam responder em até 1 dia