Bug Report Checklist
Description
A warning is logged for an endpoint that takes a list of items as the request body:
HV000271: Using @Valid on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s).
The endpoint works fine but may not do so in the future.
openapi-generator version
7.24.0
OpenAPI declaration file content or url
https://github.com/keesvandaalen/openapi-generator-demo/blob/main/api.yaml
Generation Details
https://github.com/keesvandaalen/openapi-generator-demo/blob/b38efb8270229f2f760dc4dae505e53d7420d1fa/pom.xml#L56
Steps to reproduce
- Checkout https://github.com/keesvandaalen/openapi-generator-demo/tree/main
- Run
mvn spring-boot:run
- Call the endpoint:
curl -X POST -H 'Content-Type: application/json' -d '[1,2,3]' http://localhost:8080/api/v1/demo
- Inspect the logs to see this warning: HV000271: Using
@Valid on a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s). Affected element: ApiApi#apiV1DemoPost(List)
Related issues/PRs
None
Suggest a fix
Uncomment templateDirectory and do the steps to reproduce again.
Now there is no warning.
Bug Report Checklist
Description
A warning is logged for an endpoint that takes a list of items as the request body:
The endpoint works fine but may not do so in the future.
openapi-generator version
7.24.0
OpenAPI declaration file content or url
https://github.com/keesvandaalen/openapi-generator-demo/blob/main/api.yaml
Generation Details
https://github.com/keesvandaalen/openapi-generator-demo/blob/b38efb8270229f2f760dc4dae505e53d7420d1fa/pom.xml#L56
Steps to reproduce
mvn spring-boot:runcurl -X POST -H 'Content-Type: application/json' -d '[1,2,3]' http://localhost:8080/api/v1/demo@Validon a container (java.util.List) is deprecated. You should apply the annotation on the type argument(s). Affected element: ApiApi#apiV1DemoPost(List)Related issues/PRs
None
Suggest a fix
Uncomment templateDirectory and do the steps to reproduce again.
Now there is no warning.