Bug Report Checklist
Description
When the query parameter type is declare in a different yaml file but imported as reference and when the type is Array of Enum, it was notice that the client generation produces a not compiling java code.
In the client code, the method argument matching the query parameter is now annotated with @Valid (this was introduced in the openapi version 7.2.0) however the class does not import the annotation resulting in a "cannot find symbol" compilation issue.
openapi-generator version
The version 7.2.0 introduced this issue.
OpenAPI declaration file content or url
Content of first.yaml file
...
paths:
/resource:
get:
parameters:
- in: query
name: queryParamListOfEnum
required: false
schema:
type: array
items:
$ref: './second.yaml#/components/schemas/QueryParamListOfEnum'
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Resource'
...
Content of second.yaml file
...
components:
schemas:
QueryParamListOfEnum:
type: string
enum:
- "ABC"
- "DEF"
...
Generation Details
openapi-generator-maven-plugin
configuration:
<useJakartaEe>true</useJakartaEe>
<library>webclient</library>
<useTags>true</useTags>
<dateLibrary>java8</dateLibrary>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
<apiPackage>${api.package}.client</apiPackage>
<modelPackage>${api.package}.client.models</modelPackage>
Suggest a fix
Include the missing "import jakarta.validation.Valid;" import in the generated client class.
Bug Report Checklist
Description
When the query parameter type is declare in a different yaml file but imported as reference and when the type is Array of Enum, it was notice that the client generation produces a not compiling java code.
In the client code, the method argument matching the query parameter is now annotated with @Valid (this was introduced in the openapi version 7.2.0) however the class does not import the annotation resulting in a "cannot find symbol" compilation issue.
openapi-generator version
The version 7.2.0 introduced this issue.
OpenAPI declaration file content or url
Content of first.yaml file
Content of second.yaml file
Generation Details
openapi-generator-maven-plugin
configuration:
Suggest a fix
Include the missing "import jakarta.validation.Valid;" import in the generated client class.