Skip to content
New issue

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

[Bug][Java/Spring] OAS3 related bugfixes and enhancements #11526

Merged
merged 7 commits into from
Feb 5, 2022

Conversation

cachescrubber
Copy link
Contributor

@cachescrubber cachescrubber commented Feb 5, 2022

Further OAS3 related bugfixes and enhancements. A follow up to #11181.

Fixes

Supersedes

Other OAS3 related fixes not included here:

PR checklist

  • [x ] Read the contribution guidelines.
  • [ x] 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.
  • [ x] Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    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.
  • [x ] File the PR against the correct branch: master (5.3.0), 6.0.x
  • [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.

@cachescrubber
Copy link
Contributor Author

@welshm, @wing328 FYI

@cachescrubber
Copy link
Contributor Author

@wing328 The Samples up-to-date check fails, no idea why. Should be all up 2 date.

@wing328
Copy link
Member

wing328 commented Feb 5, 2022

cc @OpenAPITools/generator-core-team as the change impacts CodegenModel.

@wing328
Copy link
Member

wing328 commented Feb 5, 2022

LGTM. For the CI failure, it has been fixed in the master.

1 similar comment
@wing328
Copy link
Member

wing328 commented Feb 5, 2022

LGTM. For the CI failure, it has been fixed in the master.

@wing328 wing328 merged commit 194b3fd into OpenAPITools:master Feb 5, 2022
@cachescrubber
Copy link
Contributor Author

That was quick. Thanks. If you can, have a look at #11475 (LGTM)

@cachescrubber cachescrubber deleted the bugfix/spring_generator branch February 5, 2022 10:31
{{#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}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

@cachescrubber cachescrubber Feb 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants