OpenAPI vocabulary or dialect for code generation
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
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- openapi
- Ambito
- api
Direzione di ricerca
Inizia dall’issue #2542 e rivedi le restrizioni sulla generazione del codice elencate e le relative motivazioni. Determina se il progetto vuole un vocabolario o un dialetto OpenAPI condiviso, quindi definisci un insieme di regole concordato e come debba essere codificato. Il lavoro è completato quando l’ambito e la rappresentazione sono definiti, invece di rimanere una proposta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Code generation tools often have special requirements or restrictions on the structure of an OpenAPI definition (document?) that improve the generated code. Here are some examples of restrictions from the IBM OpenAPI SDK generator:
-
Parameters must be unique by name only, irrespective of "in".
Rationale: Operation parameters are often rendered as the parameters on a function or method in the target language of the code generator. Since most languages require parameters to have unique names, the code generator would need to incorporate the
inof a parameter into its name to prevent name collisions. This is undesirable, since it exposes the mechanics of the API without adding any value. -
There should be at most one success response with a response body. A 204 and other 2XX is okay, but no other combination of two or more 2XX responses.
Rationale: In statically-typed languages like Java, the return value of a method must have a single static type. This makes it difficult to represent an operation with two different response schemas as a single method returning a single response type.
-
Property names and parameter names must be "case-insensitive" unique
Rationale: Code generators often reformat the names of parameters, properties, and schemas to use idomatic case formatting for the target language: lower_snake_case for Python, lowerCamelCase for Java, etc. But this reformatting could introduce naming conflicts if two parameters, e.g. "foo_bar" and "fooBar" are not "case-insensitive" unique.
-
Arrays must contain items of a single type
Rationale: Many languages require an array to contain only values of a single type.
-
Schema type must specify a single type -- no type arrays
Rationale: Some widely-used statically-typed languages, e.g. Java and Go) have no provision for "union" types, making it impossible to define a
type: [ integer, string ]typed property or parameter. -
Don't use "nullable"
Rationale: it's deprecated, and is just an alternate way of expressing type arrays
-
Don't use JSON schema "not"
Rationale There's no obvious way to represent this in many widely used programming languages.
-
No "if-then-else" in JSON schema
Rationale There's no obvious way to represent this in many widely used programming languages.
-
The API document should be "self contained" (no external "$refs")
Rationale: External refs can easily create multiple namespaces for schemas, parameters, security schemes, etc. These are unnecessary complications for code generators.
-
All "$refs" must be to elements in the "components" section of the document
Rationale: "$ref" targets outside of "components" are unnecessary complications for code generators.
It would be nice to have a common set of rules like this that could be codified into a "Code generation" vocabulary or dialect for OpenAPI.
- 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 32 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
-
status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
a2ui-project/a2ui#3158 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
SocialGouv/iterion#2369 ·
I maintainer di solito rispondono entro 1 giorno
-
Consolidate the now-identical CLI-native and composed tasks_packages guards (#5945 follow-up)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
spec-kitty/spec-kitty#6112 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedForse già presa @Mrun25 l’ha presa oggi. Apertabug llm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BerriAI/litellm#46095 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
uberdeveloper/fastbt#29 ·