Improved rendering of python function params and docstrings in IDEs#10331
Merged
spacether merged 1 commit intoOpenAPITools:masterfrom Sep 6, 2021
bflaton:python-client-docstring
Merged
Improved rendering of python function params and docstrings in IDEs#10331spacether merged 1 commit intoOpenAPITools:masterfrom bflaton:python-client-docstring
spacether merged 1 commit intoOpenAPITools:masterfrom
bflaton:python-client-docstring
Conversation
…nction parameters nicely in IDE. Endpoints are still accessible in generated code, mainly to satisfy some test cases.
Contributor
Author
|
As indicated by the PR checklist, mentioning the technical committee.. sorry if i misunderstood and now spam you all ;-) @taxpon @frol @mbohlool @cbornet @kenjones-cisco @tomplus @Jyhess @arun-nalla @spacether |
spacether
approved these changes
Sep 6, 2021
Contributor
spacether
left a comment
There was a problem hiding this comment.
This looks great; thank you for your PR!
Member
|
Travis CI failed with the following errors: Please take a look when you've time. Ref: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/237050559 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale: IDEs like pycharm don't render the docstrings from the generated code well because of the Endpoint indirection that currently exists in the code. The proposed change put the actual functions on the api, which enables the IDE to both give parameter hints as well as render proper documentation.
Endpoints are still accessible in generated code, mainly to satisfy some test cases. Maybe a cleaner way to go about testing settings on endpoints would be to inject something like an Endpoint factory into the api classes, which test cases can use to assert stuff. But in order to make the PR as small as possible, I left that change out.
The only changes that I needed to make to the test cases was to still have them refer the endpoints, since their old names are now used by the newly introduced functions.
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