Skip to content

Python sdk anyof allof root model#22955

Open
padznich wants to merge 13 commits into
OpenAPITools:masterfrom
padznich:python-sdk-anyof-allof-root-model
Open

Python sdk anyof allof root model#22955
padznich wants to merge 13 commits into
OpenAPITools:masterfrom
padznich:python-sdk-anyof-allof-root-model

Conversation

@padznich

@padznich padznich commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    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*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.

Summary by cubic

Moves Python anyOf/oneOf models to Pydantic v2 RootModel and updates generated models, docs, and samples to Pydantic’s validation/serialization APIs. Fixes RootModel edge cases (e.g., Pig) and strips directory traversal from download filenames; tests and samples updated.

  • New Features

    • anyOf/oneOf now use RootModel[Union[...]] with the value on .root; attribute access delegates to .root.
    • Inline enums (including lists) use Literal[...] with Field alias/description.
    • Docs/samples now use model_validate_json/model_dump_json/model_dump/model_validate.
  • Migration

    • Use model_validate_json/model_dump_json/model_dump/model_validate instead of to_json/from_json/to_dict/to_str; legacy helpers removed from generated models.
    • For anyOf/oneOf, access the underlying value via .root.

Written for commit e260bb2. Summary will update on new commits.

Loading
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.

2 participants