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

improvement: improve discriminated union object naming #4243

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

armandobelardo
Copy link
Contributor

@armandobelardo armandobelardo commented Aug 9, 2024

A new configuration is introduced to make discriminated union member naming more Pythonic. With V1 union naming, member names change from <UnionName>_<DiscriminantValue> to <DiscriminantValue><UnionName>. Concretely, union members previously named Chat_User will now be named UserChat under the new configuration.

generators:
  - name: fernapi/fern-python-sdk
    config:
      pydantic_config:
        union_naming: "v1" # Other valid option is: "v0"

This also removes some of the old seed files within the python seed folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants