You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can find below a portion of my swagger file containing a GET API with an enum query param (codiceCompagnia) and also the java code generated. As you can see the allowed values of the param codiceCompagnia (RMA and ITA) are not described in the java code.
The right code should something like this: I have only add the string ", in = ParameterIn.QUERY,schema=@Schema(allowableValues={ "RMA", "ITA" })" after the parameter "required = true".
public ResponseEntity<RispostaAmministratoreCondomini> elencoCondominiV10(@NotNull @Parameter(name = "codiceCompagnia", description = "Codice della compagnia", required = true, in = ParameterIn.QUERY,schema=@Schema(allowableValues={ "RMA", "ITA" })) @Valid @RequestParam(value = "codiceCompagnia", required = true) String codiceCompagnia) {
This issue does not trigger the check of the value entered in the input parameter.
openapi-generator version
7.11.0
OpenAPI declaration file content or url
/condomini/v1.0:
get:
description: Restituisce l'elenco dei condomini associati all'amministratore
operationId: elencoCondomini_v10
parameters:
- name: canale
in: query
description: Canale di richiamo del servizio
required: true
schema:
type: string
- name: codiceCompagnia
in: query
description: Codice della compagnia
required: true
schema:
type: string
enum:
- RMA
- ITA
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
Running the following command, the interface classes created don't contain the list of allowed values of the enum parameters in query string.
java -jar openapi-generator-cli-7.10.0.jar generate -i swaggerAnagrafe.yaml -g spring --api-package it.realeites.anagrafe.api --model-package it.realeites.anagrafe.model --group-id it.realeites.anagrafe --artifact-id APIAnagrafeRealeItes --artifact-version 1.0 -o APIAnagrafeRealeItes-SERVER --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true,REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true --skip-validate-spec --additional-properties=useSpringBoot3=true,java.version=21
You can find below a portion of my swagger file containing a GET API with an enum query param (codiceCompagnia) and also the java code generated. As you can see the allowed values of the param codiceCompagnia (RMA and ITA) are not described in the java code.
Java code generated
The right code should something like this: I have only add the string ", in = ParameterIn.QUERY,schema=@Schema(allowableValues={ "RMA", "ITA" })" after the parameter "required = true".
This issue does not trigger the check of the value entered in the input parameter.
openapi-generator version
7.11.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: