[Bug][Java/Spring] OAS3 related bugfixes and enhancements#11526
[Bug][Java/Spring] OAS3 related bugfixes and enhancements#11526wing328 merged 7 commits intoOpenAPITools:masterfrom
Conversation
|
@wing328 The Samples up-to-date check fails, no idea why. Should be all up 2 date. |
|
cc @OpenAPITools/generator-core-team as the change impacts CodegenModel. |
|
LGTM. For the CI failure, it has been fixed in the master. |
1 similar comment
|
LGTM. For the CI failure, it has been fixed in the master. |
|
That was quick. Thanks. If you can, have a look at #11475 (LGTM) |
| @@ -1 +1 @@ | |||
| {{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}, schema = @Schema(description = ""{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}})){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/swagger1AnnotationLibrary}} No newline at end of file | |||
| {{#swagger2AnnotationLibrary}}@Parameter(name = "{{{baseName}}}", description = "{{{description}}}"{{#required}}, required = true{{/required}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/swagger1AnnotationLibrary}} No newline at end of file | |||
There was a problem hiding this comment.
I still think we should make the @Schema annotation work. Are enum values properly documented otherwise?
I'm surprised none of the generated samples changed with this.
There was a problem hiding this comment.
There are a few:
@NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, schema = @Schema(description = "", allowableValues = { "available", "pending", "sold" })) @Valid @RequestParam(value = "status", required = true) List<String> status
This would be a perfect valid PR. We would need to identify when @Schema should be used and what information springdoc could otherwise deduct form the Spring MVC annotations and/or Method Parameters is affected.
We had the same discussion with the @io.swagger.v3.oas.annotations.parameters.RequestBody annotation.
There was a problem hiding this comment.
I'm trying to see if I can get the annotation tk be present with the type field set, and see if they resolves the issue.
If it does, then likely we can always set @Schema - but the openApiType is not currently a value available to Java generators so I'm looking at how to appropriately add that.
Further OAS3 related bugfixes and enhancements. A follow up to #11181.
Fixes
Supersedes
Other OAS3 related fixes not included here:
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x