v3.3: Global parameters
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- openapi
- Ambito
- api, documentation
Direzione di ricerca
Leggi prima la discussione #5314, quindi esamina le regole dei parametri OpenAPI 3.3 descritte in questa issue. Il lavoro è completato quando si è deciso se aggiungere un campo parameters globale e si è registrato il comportamento scelto per i parametri path, querystring, header, query e cookie.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Markdown
- Stelle
- 31.2k
- Fork
- 9.2k
- Merge medio
- 2g 9h
- PR unite (30g)
- 17
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OAI/OpenAPI-Specification
-
Housekeeping
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 45/100
OAI/OpenAPI-Specification#5566 ·
I maintainer di solito rispondono entro 1 giorno
-
Housekeeping
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 35/100
OAI/OpenAPI-Specification#5562 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Housekeeping
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
OAI/OpenAPI-Specification#5556 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
v3.2.1 releaseForse di nuovo libera @lornajane l’ha presa 33 giorni fa e non c’è nessuna pull request aperta. Aperta
OAI/OpenAPI-Specification#5460 · 11 commenti · 1 reazione · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
param serialization
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
OAI/OpenAPI-Specification#5366 · 12 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di OAI/OpenAPI-Specification
Issue simili
-
[Bug]: Streamed /v1/chat/completions sends unredacted agent error text (keys) in the final chunkForse già presa @rodricksz4h5 l’ha presa oggi. Apertaarea/streaming comp/gateway P2 type/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#138245 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
Luligu/matterbridge#655 ·
-
enhancement
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
graygarbage/HermesKey#23 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
we-promise/sure#4199 ·
I maintainer di solito rispondono entro 1 giorno