OpenAPI vocabulary or dialect for code generation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- openapi
- 領域
- api
調査の方向性
issue #2542 から始め、列挙されているコード生成の制約とその根拠を確認してください。プロジェクトが共有の OpenAPI ボキャブラリまたは方言を求めているかを判断し、そのうえで合意されたルール一式と、それをどのようにコード化するかを定義してください。完了とは、提案のまま残すのではなく、対象範囲と表現方法が解決されていることを意味します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Markdown
- スター
- 31.2k
- フォーク
- 9.2k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OAI/OpenAPI-Specification のほかの issue
-
Housekeeping
難易度 1/5 1時間未満 初心者へのやさしさ 45/100
OAI/OpenAPI-Specification#5566 ·
メンテナーはふだん 1 日以内に返信
-
Housekeeping
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
OAI/OpenAPI-Specification#5562 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Housekeeping
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
OAI/OpenAPI-Specification#5556 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
v3.2.1 release再び着手できるかも @lornajane が 32 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
OAI/OpenAPI-Specification#5460 · コメント 11 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
param serialization
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
OAI/OpenAPI-Specification#5366 · コメント 12 件 ·
メンテナーはふだん 1 日以内に返信
OAI/OpenAPI-Specification の issue をすべて見る
似ている issue
-
status: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
a2ui-project/a2ui#3158 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
SocialGouv/iterion#2369 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
spec-kitty/spec-kitty#6112 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter served対応中かも @Mrun25 が今日担当しました。 オープンbug llm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BerriAI/litellm#46095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
uberdeveloper/fastbt#29 ·