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

[Bug]: 2.1.48 2xx response written as $ref: '#/components/responses/X' generates void.

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

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

評価

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

調査の方向性

Start by locating how swagger-parser resolves $ref values under components/responses and how the resolved response schema reaches generated return types; the payload names no source files or tests. Compare parsing the referenced 202 response with the inline response schema shown in the report. Done means the referenced response retains its typed return value instead of producing void.

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

説明

Bug

Description

2xx responses written as $ref: '#/components/responses/X' generate void / ApiResponse<Void>.

Affected Version

2.1.48

Steps to Reproduce

      responses:
	        202:
	          $ref: '#/components/responses/RequestAcceptedResponse'

generates

    /**
     * Does a thing
     * @param thing ID
     * @throws ApiException If API call fails
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 202 </td><td>  </td><td>  -  </td></tr>
        <tr><td> 0 </td><td>  </td><td>  -  </td></tr>
     </table>
     */
    public void doAThing(String thingID) throws ApiException {
        doAThingWithHttpInfo(thingID);
    }
      responses:
	        202:
	          description: Request accepted. Confirmation of success/failure of request to be sent asynchronously via SNS.
	          content:
	            application/json:
	              schema:
	                $ref: '#/components/schemas/responseBody'

generates the expected response type.

Expected Behavior

parsing should not cause typed object references to generate void returns in client code

Actual Behavior

typed object references in the swagger schema generate void returns in client code

Environment

  • Java version: JDK 17
  • Build tool: Gradle 7.x, 8.x
  • OS: AmazonLinux2 x86_64

Additional Context

NA

Checklist

I've searched, but don't often work with swagger and don't have full visibility into the build toolchain being run.
If this smells like a duplicate to the maintainers, please feel free to resolve.

  • I have provided sufficient information for maintainers to reproduce the issue.
    As above, made my best effort in the time available.
主要言語
Java
スター
870
フォーク
565
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

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

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

似ている issue

Java の issue をもっと見る

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

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