We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We are unable to generate beanValidation annotations for RequestBody params. Looks like the feature was missing in revision 8952815
Proposed changes should cover this bug and allow beanValidation annotations to be generated on RequestBody params too.
6.2.1 , current master
Provided configuration:
paths: /add: post: requestBody: content: application/json: schema: type: integer title: quantity minimum: 2 required: true responses: '200': description: OK content: application/json: schema: type: boolean
Generates:
@Operation( operationId = "addPost", responses = { @ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Boolean.class))) } ) @RequestMapping( method = RequestMethod.POST, value = "/add", produces = { "application/json" }, consumes = { "application/json" } ) default ResponseEntity<Boolean> cartKekPost( @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Integer body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); }
Must have:
default ResponseEntity<Boolean> addPost( @Min(2) @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Integer body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); }
Plugin configuration: (beanValidation is enabled by default)
generatorName = 'spring' configOptions = [ dateLibrary: 'java8', interfaceOnly: 'true', openApiNullable: 'false', java8: 'false' ] importMappings = ['java.time.OffsetDateTime': 'java.time.Instant'] typeMappings = ['OffsetDateTime': 'Instant']
./gradlew openApiGenerate
#13936
will propose a solution as PR from fork repository https://github.com/Mintas/openapi-generator
The text was updated successfully, but these errors were encountered:
added JavaSpring beanValidation for RequestBody parameters OpenAPIToo…
2c79cbc
…ls#13932
added JavaSpring beanValidation for RequestBody parameters fix #13932 (…
6b06441
…#13936)
Successfully merging a pull request may close this issue.
Description
We are unable to generate beanValidation annotations for RequestBody params. Looks like the feature was missing in revision 8952815
Proposed changes should cover this bug and allow beanValidation annotations to be generated on RequestBody params too.
openapi-generator version
6.2.1 , current master
OpenAPI declaration file content or url
Provided configuration:
Generates:
Must have:
Command line used for generation
Plugin configuration: (beanValidation is enabled by default)
generatorName = 'spring'
configOptions = [
dateLibrary: 'java8',
interfaceOnly: 'true',
openApiNullable: 'false',
java8: 'false'
]
importMappings = ['java.time.OffsetDateTime': 'java.time.Instant']
typeMappings = ['OffsetDateTime': 'Instant']
Steps to reproduce
./gradlew openApiGenerate
Related issues/PRs
#13936
Suggest a fix/enhancement
will propose a solution as PR from fork repository https://github.com/Mintas/openapi-generator
The text was updated successfully, but these errors were encountered: