[JAVA] 3.0.65 java stub generates method with no return value for get endpoints if $ref is used
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
調査の方向性
まず test.yaml と記載されている swagger-codegen CLI コマンドで問題を再現し、次に whateverGet エンドポイントと、それが参照する response の Java 生成を追跡します。$ref の response が 3.0.64 と同様に戻り値の型と resp.getData() を生成し、inline schema に回帰がない状態を完了とします。
索引モデルが issue の本文から書いたものです。
説明
Description
With 3.0.65 the methods that are generated for get endpoints (havent checked others) are not returning anything. Same specs worked with 3.0.64.
The generated code looks like this:
public void whateverGet() throws ApiException {
whateverGetWithHttpInfo();
}
while with 3.0.64:
public InlineResponse200 whateverGet() throws ApiException {
ApiResponse<InlineResponse200> resp = whateverGetWithHttpInfo();
return resp.getData();
}
If i put the schema directly, without using the $ref, the generated code is having the return statement.
Swagger-codegen version
3.0.65
Swagger declaration file content or url
openapi: 3.0.1
paths:
/whatever:
get:
responses:
"200":
$ref: "#/components/responses/WhateverGetResponse"
components:
responses:
WhateverGetResponse:
description: test
content:
application/json:
schema:
type: object
properties:
name:
type: string
Command line used for generation
java -jar ~/Downloads/swagger-codegen-cli-3.0.65.jar generate -i test.yaml -l java -o ./debug -DhideGenerationTimestamp=true
Steps to reproduce
just generate with 3.0.65
Related issues/PRs
Suggest a fix/enhancement
- 主要言語
- Mustache
- スター
- 17.8k
- フォーク
- 6k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- 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 ·
-
[JAVA] Non compilable enums generated with property errorOnUnknownEnum=true対応中かも @HiagoW が 1462 日前に担当しました。 オープン
難易度 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
-
review-bot
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
autowarefoundation/autoware_carla_scenario#323 ·
メンテナーはふだん 1 日以内に返信
-
useFrecencySorting ignores how long ago an item was visited when sorting対応中かも @auraseb が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Gentleman-Programming/gentle-ai#5603 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信