Created by: gokul-krishnamoorthy
Read / Write access specifier proper was not available for properties marked as required. Hence adding the read/write annotation to the bean class validator config in beanValidation.mustache file.
This will help to have read/write only specifier for required property during Bean Class validation.
For required attributes, generate @NotNull only, if attribute is neither readOnly nor writeOnly. This reflects the spec https://swagger.io/docs/specification/data-models/data-types/#readonly-writeonly
If a readOnly or writeOnly property is included in the required list, required affects just the relevant scope – responses only or requests only. That is, read-only required properties apply to responses only, and write-only required properties – to requests only. Using @NotNull for these cases would fail validation in the other direction, where the attribute is intentionally not present.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
(5.3.0),6.0.x
-
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.