quarkus-openapi-generator
quarkus-openapi-generator copied to clipboard
Bean validation not working
Hello
It seems that server side bean validation is ignored. YML Schema:
UserCredentials:
type: object
required:
- userName
- password
properties:
userName:
type: string
password:
type: string
Beans
/**
*
* (Required)
*
*/
@JsonProperty("userName")
private String userName;
/**
*
* (Required)
*
*/
@JsonProperty("password")
private String password;
A request that is missing a parameter should yield HTTP Code 400
Is there a configuration or package that I have overlooked?
@ricardozanini @hbelmiro This is being labeled as Stale.
@ricardozanini @hbelmiro This is being labeled as Stale.
@ricardozanini @hbelmiro This is being labeled as Stale.
It should be solved by this pull request https://github.com/Apicurio/apicurio-codegen/pull/345! Let's wait a little more :)
@ricardozanini @hbelmiro This is being labeled as Stale.
@mcruzdev has this one been solved already?
Yes @ricardozanini, we can close this one.
@krisraich, please, use the quarkus.openapi-generator.use-bean-validation property to enable this one.
Hi!
Thanks for the update!
I've updated the quarkus-openapi-generator-server dependency to 2.12.0 and set quarkus.openapi.generator.use-bean-validation to true. However, it does not seem to make any difference. I've also added quarkus-hibernate-validator... Still no Jakarta Valid annotation on the resource interfaces or beans. The x-codegen-annotations works fine though.
Also, x-codegen-contextRoot seems not to be working.
I finally figured it out.. The configuration key is different as what is stated in the documentation. But it is fixed now with 2.12.1.
Validation works now like a charm 👍
Hello,
I used 2.13.0-lts and quarkus.openapi.generator.use-bean-validation=true did not work for me. I had to change it to quarkus.openapi.generator.bean-validation=true.
However I am confused since the doc update on 2.12.1 changed it from bean-validation to use-bean-validation. Is this a regression?
Yea, it seems to be quarkus.openapi.generator.bean-validation=true It is also wrong in the docs at https://docs.quarkiverse.io/quarkus-openapi-generator/dev/server.html#quarkus-openapi-generator-server_quarkus-openapi-generator-use-bean-validation
cc @mcruzdev