Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Conversion from v2 to v3 incorrectly changes additionalProperties: {} into additionalProperties: type: object

オープン
#12,468 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
openapi
領域
api, tooling

調査の方向性

提供された swagger-codegen-cli コマンドをリンクされた OpenAPI v2 YAML に対して実行し、空の additionalProperties 値の変換経路を調査します。生成された OpenAPI v3 YAML がそれを additionalProperties: {} または additionalProperties: true として保持し、type: object を割り当てなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

P3 pull-request-welcome Swagger-Parser
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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

swagger-api/swagger-codegen のほかの issue

swagger-api/swagger-codegen の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。