Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#2,408 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Java
Estrellas
870
Forks
566
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de swagger-api/swagger-parser

Todos los issues de swagger-api/swagger-parser

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.