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

[Python][Client] Fix delimiter collision issue #5981 #6451

Merged
merged 5 commits into from
Jun 1, 2020

Conversation

fullcircle23
Copy link
Contributor

@fullcircle23 fullcircle23 commented May 27, 2020

Wrapped the string literals for the default and example values using double quotes (instead of single quotes) to avoid the need to escape any embedded single quotes and also to avoid any invalid syntax errors due to delimiter collision in the generated test code.

Test Files:

  • Updated 1 test.
  • Added 1 test.

Updated sample files after running the following:

  • bin/python-petstore-all.sh
  • bin/openapi3/python-petstore.sh
  • bin/openapi3/python-experimental-petstore.sh

Open Issues

If merged, this will resolve #5981

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

Note: This PR replaces PR #5982

@spacether @wing328

@wing328
Copy link
Member

wing328 commented May 27, 2020

The python (oas3) tests failed. Please refer to https://travis-ci.org/github/OpenAPITools/openapi-generator/builds/691670401 for more information.

@fullcircle23
Copy link
Contributor Author

The python (oas3) tests failed. Please refer to https://travis-ci.org/github/OpenAPITools/openapi-generator/builds/691670401 for more information.

Took a while to debug this. It seems I need to wrap the default and example "enum" property values as well.

@spacether spacether added this to the 5.0.0 milestone May 28, 2020
LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue");
}
Copy link
Member

Choose a reason for hiding this comment

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

FYI. Looks like these changes are not indented properly (2-space vs 4-space). I can fix it later after merging this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted. Thank you!

@wing328
Copy link
Member

wing328 commented May 29, 2020

If no further feedback/question on this PR, I'll merge it over the weekend.

@wing328 wing328 merged commit 6783b90 into OpenAPITools:master Jun 1, 2020
wing328 added a commit that referenced this pull request Jun 1, 2020
@wing328 wing328 mentioned this pull request Jun 1, 2020
5 tasks
@wing328
Copy link
Member

wing328 commented Jun 1, 2020

Unfortunately, we need to roll back this change as it's causing CircleCI failure after merging into master. Please refer to the PR with the details: #6514

I'll see if I can file a PR to fix the issue in the coming weekend.

wing328 added a commit that referenced this pull request Jun 1, 2020
* Revert "Minor enhancement to Python client generator's code format (#6510)"

This reverts commit 3ddc783.

* Revert "[Python][Client] Fix delimiter collision issue #5981 (#6451)"

This reverts commit 6783b90.
jimschubert added a commit that referenced this pull request Jun 2, 2020
* master:
  Update Generate.java (#6515)
  Undo PR #6451 (#6514)
  Minor enhancement to Python client generator's code format (#6510)
  [python-experimental] Quicken package loading (#6437)
  [Python][Client] Fix delimiter collision issue #5981 (#6451)
  [Java][Jersey2] add petstore integration tests (#6508)
  UE4 client generator fixes (#6438)
  Fix docs typos (#6478)
  [php-laravel] Show required PHP version in docs (#6502)
  [php-lumen] Show required PHP version in docs (#6501)
  [Java][Jersey2] Fix typo and script, Log enhancements, HTTP signature, deserialization (#6476)
  Remove deprecations 5.0 (#6060)
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.

[BUG][Python] Single quotes in default/example string cause invalid syntax error in generated test code
3 participants