Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#2,408 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Java
Stelle
870
Fork
565
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di swagger-api/swagger-parser

Tutte le issue di swagger-api/swagger-parser

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.