Conversion from v2 to v3 incorrectly changes additionalProperties: {} into additionalProperties: type: object
まだ誰も着手していません。
評価
調査の方向性
提供された swagger-codegen-cli コマンドをリンクされた OpenAPI v2 YAML に対して実行し、空の additionalProperties 値の変換経路を調査します。生成された OpenAPI v3 YAML がそれを additionalProperties: {} または additionalProperties: true として保持し、type: object を割り当てなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
I have an OpenAPI v2 yaml that is being converted to v3 by swagger-codegen-cli, and it ends up changing the behavior of my models from allowing any freeform additional properties of any type, to only allowing properties of type object.
Swagger-codegen version
3.0.61
Swagger declaration file content or url
My openapi v2 yaml includes:
protobufAny:
type: object
properties:
'@type':
type: string
additionalProperties: {}
This is converted by swagger-codegen-api into this yaml:
protobufAny:
type: object
properties:
'@type':
type: string
additionalProperties:
type: object
Command line used for generation
swagger-codegen-cli generate -i ./openapiv2/gen/awesome.swagger.yaml -l openapi-yaml -o ./openapiv3/gen/
Steps to reproduce
See above
Related issues/PRs
N/A
Suggest a fix/enhancement
This v2 yaml should convert to additionalProperties: {} or additionalProperties: true
- 主要言語
- Mustache
- スター
- 17.8k
- フォーク
- 6k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
swagger-api/swagger-codegen のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
swagger-api/swagger-codegen#12755 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
swagger-api/swagger-codegen#12445 ·
-
security vulnerability
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
swagger-api/swagger-codegen#11942 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
swagger-api/swagger-codegen#11812 · リアクション 1 件 ·
-
security vulnerability
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
swagger-api/swagger-codegen#11594 ·
swagger-api/swagger-codegen の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
vllm-project/vllm-metal#822 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BasedHardware/omi#19047 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ditto-assistant/ditto-subnet#2346 ·
メンテナーはふだん 1 日以内に返信