OpenAPI vocabulary or dialect for code generation
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- openapi
- Bereich
- api
Rechercherichtung
Beginne mit issue #2542 und prüfe die dort aufgeführten Einschränkungen für die Codegenerierung und ihre Begründungen. Ermittle, ob das Projekt ein gemeinsames OpenAPI-Vokabular oder einen Dialekt möchte, und lege anschließend einen vereinbarten Regelsatz sowie fest, wie dieser kodifiziert werden soll. Erledigt bedeutet, dass Umfang und Repräsentation geklärt sind, anstatt als Vorschlag bestehen zu bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Markdown
- Sterne
- 31.2k
- Forks
- 9.2k
- Ø Merge
- 2 T. 9 Std.
- Gemergte PRs (30 T.)
- 17
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus OAI/OpenAPI-Specification
-
Housekeeping
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 45/100
OAI/OpenAPI-Specification#5566 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Housekeeping
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 35/100
OAI/OpenAPI-Specification#5562 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Housekeeping
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 10/100
OAI/OpenAPI-Specification#5556 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
v3.2.1 releaseEvtl. wieder frei @lornajane hat das vor 33 Tagen übernommen, und es ist kein Pull Request offen. Offen
OAI/OpenAPI-Specification#5460 · 11 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
param serialization
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
OAI/OpenAPI-Specification#5366 · 12 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in OAI/OpenAPI-Specification
Ähnliche Issues
-
Notifications pagination accepts NaN and negative LIMIT/OFFSETEvtl. vergeben @Senthil455 hat das heute übernommen. OffenBUGS MEDIUM
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
elixpo/blogs.elixpo#419 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: agent_final_response still returns the abandoned branch's answer after navigate moves HEAD backEvtl. vergeben @enyst hat das heute übernommen. Offenbug priority:low ready-for-dev
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
OpenHands/software-agent-sdk#5822 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: server enhancement good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
scs0209/laya-guard#52 ·
Maintainer antworten meist innerhalb von 1 Tag
-
priority:high
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100