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

[Java][Spring] fix wrong values with enum variables in path parameters which generated allowableValues with double quote #10285

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

yangguangxiadeyun
Copy link
Contributor

@yangguangxiadeyun yangguangxiadeyun commented Aug 30, 2021

Hi team and @jeff9finger @nmuesch @lwlee2608 , this PR is to fix wrong values with enum variables in path parameters which generated allowableValues with double quote(#6762)
According to javadoc swagger-annotations ApiParam, allowableValues sets a list of values, provide a comma-separated list. For example: first, second, third. If using double quote, the URL path would become something like http://example.com/foo/"bar" while we're expecting http://example.com/foo/bar. Thus I think we should not use double quote for each value when it's used in path variable.

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
    
    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.
  • 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.

@yangguangxiadeyun yangguangxiadeyun changed the title [Java][Spring] fix wrong values with enum variables in path parameters which generated allowableValues with double quote(#6762) [Java][Spring] fix wrong values with enum variables in path parameters which generated allowableValues with double quote Aug 30, 2021
@yangguangxiadeyun
Copy link
Contributor Author

yangguangxiadeyun commented Aug 30, 2021

Hi @yue9944882 @wing328 , it seems that ci/circleci build is failed with existing code and irrelevant with the change of this PR. And there are lots of PRs failed with same reason.
I see this few lines of log:

apis/PetApi.ts(360,59): error TS2554: Expected 2 arguments, but got 3.
npm ERR! code 2
npm ERR! path /home/circleci/OpenAPITools/openapi-generator/samples/openapi3/client/petstore/typescript/builds/default
npm ERR! command failed
npm ERR! command sh -c npm run build

Please help to check/follow up. Thank you.

@wing328
Copy link
Member

wing328 commented Sep 2, 2021

@yangguangxiadeyun the circleci failure has been fixed in the master so don't worry about it.

@wing328
Copy link
Member

wing328 commented Sep 2, 2021

Tested locally and confirmed the fix but this fix has a limitation if i'm not mistaken. If the enum allowable values contain double quote ", then this fix won't work but we'll instead tackle this edge cases when it comes up later.

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.

2 participants