v3.3: Global parameters
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- openapi
- Área
- api, documentation
Línea de trabajo
Lee primero la discusión #5314 y después revisa las reglas de parámetros de OpenAPI 3.3 descritas en este issue. Se considera completado cuando se haya decidido si se debe añadir un campo parameters global y se haya registrado el comportamiento elegido para los parámetros path, querystring, header, query y cookie.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Markdown
- Estrellas
- 31.2k
- Forks
- 9.2k
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 17
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OAI/OpenAPI-Specification
-
Housekeeping
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
OAI/OpenAPI-Specification#5566 ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
OAI/OpenAPI-Specification#5562 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
OAI/OpenAPI-Specification#5556 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
v3.2.1 releaseQuizá libre de nuevo @lornajane la tomó hace 33 días y no hay ningún pull request abierto. Abierto
OAI/OpenAPI-Specification#5460 · 11 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
param serialization
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
OAI/OpenAPI-Specification#5366 · 12 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de OAI/OpenAPI-Specification
Issues similares
-
sync: small cleanups after #69Abiertoarea::tern-sync kind::cleanup triage::ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Atomic append fails to create a missing filePosiblemente ocupada @harbinresearcher la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
fabiocaccamo/python-fsutil#201 ·
-
Access-request approve silently discards the decider's note (decision_note written only on deny)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Uuriko/project-room#3378 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ENTERPILOT/GoModel#1183 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cmlarsen/writemorebetter#158 ·
Los mantenedores suelen responder en 1 día