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

Fix for enum.Enum subclasses #18

Merged
merged 1 commit into from Feb 11, 2021

Conversation

kdeyev
Copy link
Contributor

@kdeyev kdeyev commented Sep 26, 2020

Hi,
I faced the same issue reported in this issue.
The solution uses another template branch for enum types.
The schema definition for the model looks like:

    Method:
      title: Method
      enum:
      - One
      - Two
      - Three
      type: string
      description: An enumeration.

And the expectation for the generated pydantic model:

class Method(str, Enum):
    ONE = "One"
    TWO = "Two"
    THREE = "Three"

Please, take a look at the changes I made.

Thanks.
Kostya.

@dmontagu dmontagu merged commit df35559 into dmontagu:master Feb 11, 2021
philipp-zettl pushed a commit to philipp-zettl/fastapi_client that referenced this pull request Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants