Skip to content

fix(graphql): increment graphql normalizer priority #6283

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

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 21 additions & 32 deletions features/openapi/docs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -396,38 +396,27 @@ Feature: Documentation support
Then the response status code should be 200
And the response should be in JSON
And the JSON node "openapi" should be equal to "3.0.0"
And the JSON node "components.schemas.DummyBoolean" should be equal to:
And the JSON node "components.schemas.DummyBoolean.properties.id.anyOf" should be equal to:
"""
{
"type": "object",
"description": "",
"deprecated": false,
"properties": {
"id": {
"readOnly": true,
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"isDummyBoolean": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
},
"dummyBoolean": {
"readOnly": true,
"type": "boolean"
}
[
{
"type": "integer"
},
{
"type": "null"
}
}
]
"""
And the JSON node "components.schemas.DummyBoolean.properties.isDummyBoolean.anyOf" should be equal to:
"""
[
{
"type": "boolean"
},
{
"type": "null"
}
]
"""
And the JSON node "components.schemas.DummyBoolean.properties.isDummyBoolean.owl:maxCardinality" should not exist

4 changes: 2 additions & 2 deletions src/Symfony/Bundle/Resources/config/graphql.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" on-invalid="ignore" />
<argument type="service" id="api_platform.security.resource_access_checker" on-invalid="ignore" />

<!-- Run before serializer.normalizer.json_serializable -->
<tag name="serializer.normalizer" priority="-890" />
<!-- Run before serializer.normalizer.json_serializable and before serializer.normalizer.backed_enum which is at 880 -->
<tag name="serializer.normalizer" priority="-878" />
</service>

<service id="api_platform.graphql.normalizer.object" class="ApiPlatform\GraphQl\Serializer\ObjectNormalizer" public="false">
Expand Down