Skip to content

OAS 3.1 multi-type cast/deserialize support#1182

Open
p1c2u wants to merge 1 commit into
masterfrom
feature/oas31-multi-type-cast-deserialize-support
Open

OAS 3.1 multi-type cast/deserialize support#1182
p1c2u wants to merge 1 commit into
masterfrom
feature/oas31-multi-type-cast-deserialize-support

Conversation

@p1c2u
Copy link
Copy Markdown
Collaborator

@p1c2u p1c2u commented May 14, 2026

Relates #1180

  • openapi_core/schema/types.py (new) pick_style_type(): maps str | list[str] → structural type (array > object > primitive).
  • casting/schemas/casters.py added MultiTypeCaster: iterates declared types, returns first successful cast, raises one CastError with the full type list on miss.
  • casting/schemas/init.py wired multi=MultiTypeCaster for OAS 3.1/3.2; OAS 3.0 stays multi=None.
  • deserializing/styles/util.py every loader (simple, form, matrix, label, delimited, deepObject) routes schema_type through pick_style_type.
  • deserializing/media_types/deserializers.py multipart array fan-out uses pick_style_type + read_str_or_list.
  • deserializing/styles/casters.py deleted (dead code).

@p1c2u p1c2u changed the title OAS 3.1 tmulti-type cast/deserialize support OAS 3.1 multi-type cast/deserialize support May 15, 2026
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.

1 participant