[JAVA] 3.0.65 java stub generates method with no return value for get endpoints if $ref is used
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Empieza reproduciendo el problema con test.yaml y el comando CLI de swagger-codegen indicado; después, sigue la generación de Java para el endpoint whateverGet y la respuesta a la que hace referencia. Se considera terminado cuando una respuesta $ref genera un tipo de retorno y resp.getData() como en 3.0.64, sin introducir regresiones en los esquemas inline.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Mustache
- Estrellas
- 17.8k
- Forks
- 6k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de swagger-api/swagger-codegen
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
swagger-api/swagger-codegen#12755 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
swagger-api/swagger-codegen#12445 ·
-
security vulnerability
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
swagger-api/swagger-codegen#11942 ·
-
[JAVA] Non compilable enums generated with property errorOnUnknownEnum=truePosiblemente ocupada @HiagoW la tomó hace 1461 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
swagger-api/swagger-codegen#11812 · 1 reacción ·
-
security vulnerability
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
swagger-api/swagger-codegen#11594 ·
Todos los issues de swagger-api/swagger-codegen
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Graphify-Labs/graphify#4524 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jhugman/uniffi-bindgen-react-native#500 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
afk-ok area:agents size:S
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
enorm-labs/event-junkie#3523 ·
Los mantenedores suelen responder en 1 día