Skip to content

fix(jsonschema): emit an empty schema for mixed - #8670

Merged
soyuka merged 1 commit into
api-platform:4.4from
soyuka:fix/jsonschema-mixed-any-8665
Oct 12, 2026
Merged

soyuka merged 1 commit into
api-platform:4.4from
soyuka:fix/jsonschema-mixed-any-8665

Conversation

@soyuka

@soyuka soyuka commented Oct 12, 2026

Copy link
Copy Markdown
Member
Q A
Branch? 4.4
Tickets Fixes #8665
License MIT
Doc PR

mixed was mapped to {type: string} ({type: [string, null]} after nullability), so an array<string, mixed> rejected {"chunk_number": 0}. mixed now emits an empty schema, any value including null. Nested empty schemas are emitted as ArrayObject so items/additionalProperties serialize as {}.

Note that TypeInfo defaults a collection's value type to mixed, so untyped array/list/iterable properties (Doctrine json, ODM hash) change from items: {type: [string, null]} to items: {}. It's looser so payloads still validate, generated clients go from string|null[] to any[].

MCP: the schema flattener only adds type: object to type-less nodes that actually describe an object (properties, additionalProperties, patternProperties, required), otherwise a mixed with a description became an object. This also fixes enum/format-only nodes.

@soyuka
soyuka merged commit a71b683 into api-platform:4.4 Oct 12, 2026
116 of 117 checks passed
@soyuka
soyuka deleted the fix/jsonschema-mixed-any-8665 branch October 12, 2026 14:38
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