[python] Add enum values as class attributes to enum models#10753
Closed
phillipuniverse wants to merge 2 commits intoOpenAPITools:masterfrom
Closed
[python] Add enum values as class attributes to enum models#10753phillipuniverse wants to merge 2 commits intoOpenAPITools:masterfrom
phillipuniverse wants to merge 2 commits intoOpenAPITools:masterfrom
Conversation
phillipuniverse
commented
Nov 1, 2021
|
|
||
| _ABC = "_abc", | ||
| -EFG = "-efg", | ||
| (XYZ) = "(xyz)", |
Contributor
Author
There was a problem hiding this comment.
Well this won't work, maybe we'll need a different solution for special characters.
|
I have the same problem, do you have an estimate when this is going to be merged? Please also note that the current PR adds newlines to many files. Would it be possible to only add the newline if there is a enum and otherwise not? |
Contributor
Author
|
Seems like there is not much appetite to do much else for this PR in this Python client. Seems like newer functionality is going into the python experimental branch. In the meantime, the workaround if you need this functionality is to:
|
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.
Fixes #10752
This adds all of the enum values as class attributes onto enum models so that they can be accessed in a typesafe way.
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@taxpon @frol @mbohlool @cbornet @kenjones-cisco @tomplus @Jyhess @arun-nalla @spacethe