"required": true for a property. Does the codgen support it?
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- devtools
調査の方向性
Start by tracing how the generator reads Schema Object properties and determines whether each TypeScript property is optional; no source file or test is named in the issue. Compare handling of the object-level required array with property-level required values, then add or update coverage so the supported behavior is explicit in the generated output.
索引モデルが issue の本文から書いたものです。
説明
I have a Schema Object
{
"Obj": {
"description": "Obj",
"required": [
"id",
"foo"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"foo": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"bar": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
}
}
}
}
With this ShemaObject, a type generates perfectly fine.
/**
* Obj
*/
export type Obj = {
/**
* @pattern ^[0-9a-f]{32}$
*/
id: string;
/**
* @pattern ^[0-9a-f]{32}$
*/
foo: string;
/**
* @pattern ^[0-9a-f]{32}$
*/
bar?: string;
};
But if I move/distribute required to properties like this
{
"Obj": {
"description": "Obj",
"properties": {
"id": {
"type": "string",
"pattern": "^[0-9a-f]{32}$",
"required": true
},
"foo": {
"type": "string",
"pattern": "^[0-9a-f]{32}$",
"required": true
},
"bar": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
}
}
}
}
It generates this:
/**
* Obj
*/
export type Obj = {
/**
* @pattern ^[0-9a-f]{32}$
*/
id?: string;
/**
* @pattern ^[0-9a-f]{32}$
*/
foo?: string;
/**
* @pattern ^[0-9a-f]{32}$
*/
bar?: string;
};
Conclusion:
It ignores this approach of requiring fields if the required is set at the property level. Is it a bug? Is it possible to set up this approach?
- 主要言語
- TypeScript
- スター
- 634
- フォーク
- 83
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fabien0102/openapi-codegen のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fabien0102/openapi-codegen#343 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fabien0102/openapi-codegen#342 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
fabien0102/openapi-codegen#356 ·
-
update dependencies & removed unused deprecated対応中かも @el-j が 10 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
fabien0102/openapi-codegen#354 ·
-
deepMerge mutates its arguments, corrupting request payloads across calls対応中かも @richard-willis-chevin が 55 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
fabien0102/openapi-codegen#349 ·
fabien0102/openapi-codegen の issue をすべて見る
似ている issue
-
Object parameters lose their structure when resources is enabled対応中かも @asts-top が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
jaegertracing/jaeger-ui#4618 ·
メンテナーはふだん 1 日以内に返信
-
pending close triaging
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
anomalyco/opencode#56765 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:plugins enhancement platform:vscode
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
anthropics/claude-code#103166 ·
メンテナーはふだん 1 日以内に返信
-
Types: FlashListProps imports ViewabilityConfig from react-native, removed in RN 0.87+対応中かも @efegokdemir が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Shopify/flash-list#2540 ·