You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON:API: JsonApiCollectionBaseSchemaNoPagination declares data as type: array without items #8699
When pagination is disabled on a GetCollection operation, the JSON:API collection response refers to JsonApiCollectionBaseSchemaNoPagination. In that schema, data is {"type": "array"} with no items.
OpenAPI 3.0 requires items when type is array, so 3.0 validators and some code generators reject the document. In 3.1 and 3.2 the schema is valid, but it says nothing about the members.
Expected:data has an items schema, for example {"type": "object"}. The concrete collection schema can still narrow it with allOf.
Possible Solution
Add 'items' => ['type' => 'object'] to data in the COLLECTION_BASE_SCHEMA_NAME_NO_PAGINATION definition in JsonApi\JsonSchema\SchemaFactory::buildSchema().
Additional Context
Checked on api-platform/core v4.4.4, Symfony 7.4, PHP 8.5, in an empty Symfony app. The code of JsonApi\JsonSchema\SchemaFactory on main is the same as in v4.4.4.
The app has only FrameworkBundle, TwigBundle and ApiPlatformBundle, with this config:
Activity
fix(jsonapi): declare items on no-pagination collection data schema
fix(jsonapi): declare items on no-pagination collection data schema (#…
soyuka commentedon Oct 19, 2026
fixed by #8727, will be in the next 5.0 patch