Repository navigation
fix(json-schema): keep operation groups in context - #8643
Merged
soyuka merged 2 commits intoOct 15, 2026
Merged
Conversation
An explicit serializer context without groups replaced the operation context, and both directions' groups were passed to the property factories. OpenAPI 3.0 docs, MCP tool schemas and the test assertions then exposed write-only properties in output schemas. Read ignored_attributes from the built direction's context too.
The operation context now fills keys missing from an explicit context, an unset groups key came back from the operation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SchemaFactory::buildSchema()used the operation's serializer context only when no context was passed. Any explicit context without groups ([SCHEMA_DRAFT4_VERSION => true]for OpenAPI 3.0,[FORCE_SUBSCHEMA => true]in the MCP loader,ApiTestAssertionsTrait,skip_null_valuesin the OpenAPI output schemas) lost the operation groups. On top of that the property factories received both directions' groups, so output schemas listed write-only properties flaggedwriteOnly, and OpenAPI 3.0 and 3.1 docs disagreed.The operation context is now merged under the explicit one for top-level calls, only the built direction's groups/attributes reach the property factories, and
ignored_attributesis read from that same context instead of always from normalization.Found while mapping
Operationusage in json-schema for symfony/symfony#64279.