From 365e119585d1bc43a5761495d43df8e6c200298c Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 12 May 2026 10:08:46 +0200 Subject: [PATCH] Fix/Enh. OpenAPI --- .../LocationChildrenListController.php | 21 ++++------ .../Location/LocationCreateController.php | 40 ++++++++----------- .../LocationForContentListController.php | 25 +++++------- .../Location/LocationLoadByPathController.php | 25 +++++------- .../Location/LocationRedirectController.php | 24 ++++------- .../LocationSubtreeDeleteController.php | 10 +++++ .../Location/LocationUpdateController.php | 40 ++++++++----------- .../ObjectStateCreateController.php | 39 ++++++++---------- .../ObjectStateDeleteController.php | 10 +++++ .../ObjectStateGroupCreateController.php | 39 ++++++++---------- .../ObjectStateGroupDeleteController.php | 10 +++++ .../ObjectStateGroupListController.php | 24 ++++------- .../ObjectStateGroupLoadByIdController.php | 24 ++++------- .../ObjectStateGroupUpdateController.php | 39 ++++++++---------- .../ObjectState/ObjectStateListController.php | 24 ++++------- .../ObjectStateLoadByIdController.php | 24 ++++------- .../ObjectStateUpdateController.php | 39 ++++++++---------- .../ObjectStatesForContentListController.php | 18 +++------ ...ObjectStatesForContentUpdateController.php | 39 ++++++++---------- 19 files changed, 215 insertions(+), 299 deletions(-) diff --git a/src/lib/Server/Controller/Location/LocationChildrenListController.php b/src/lib/Server/Controller/Location/LocationChildrenListController.php index 2b0d9ba58..a0cb5aa5d 100644 --- a/src/lib/Server/Controller/Location/LocationChildrenListController.php +++ b/src/lib/Server/Controller/Location/LocationChildrenListController.php @@ -16,21 +16,13 @@ #[Get( uriTemplate: '/content/locations/{path}/children', openapi: new Model\Operation( + operationId: 'ibexa.rest.load_location_children', summary: 'Get child Locations.', description: 'Loads all child Locations for the given parent Location.', tags: [ 'Location', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the new Location list is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'path', in: 'path', @@ -42,17 +34,18 @@ ], responses: [ Response::HTTP_OK => [ + 'description' => 'If set, the new Location list is returned in XML or JSON format.', 'content' => [ - 'application/vnd.ibexa.api.LocationList+xml' => [ + 'application/vnd.ibexa.api.LocationList+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/LocationList', + '$ref' => '#/components/schemas/LocationListWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/GET/LocationList.xml.example', ], - 'application/vnd.ibexa.api.LocationList+json' => [ + 'application/vnd.ibexa.api.LocationList+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/LocationListWrapper', + '$ref' => '#/components/schemas/LocationList', ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/path/children/GET/LocationList.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/Location/LocationCreateController.php b/src/lib/Server/Controller/Location/LocationCreateController.php index fb3698274..9128a8ee5 100644 --- a/src/lib/Server/Controller/Location/LocationCreateController.php +++ b/src/lib/Server/Controller/Location/LocationCreateController.php @@ -23,6 +23,7 @@ uriTemplate: '/content/objects/{contentId}/locations', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.create_location', summary: 'Create new Location for content item', description: 'Creates a new Location for the given content item.', tags: [ @@ -30,19 +31,10 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the new Location is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The LocationCreate schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], @@ -57,36 +49,38 @@ ), ], requestBody: new Model\RequestBody( + description: 'The LocationCreate schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.LocationCreate+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/LocationCreate', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/LocationCreate.xml.example', - ], 'application/vnd.ibexa.api.LocationCreate+json' => [ 'schema' => [ '$ref' => '#/components/schemas/LocationCreateWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/LocationCreate.json.example', ], + 'application/vnd.ibexa.api.LocationCreate+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/LocationCreate', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/LocationCreate.xml.example', + ], ]), ), responses: [ Response::HTTP_CREATED => [ + 'description' => 'If set, the new Location is returned in XML or JSON format.', 'content' => [ - 'application/vnd.ibexa.api.Location+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/Location', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.xml.example', - ], 'application/vnd.ibexa.api.Location+json' => [ 'schema' => [ '$ref' => '#/components/schemas/LocationWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.json.example', ], + 'application/vnd.ibexa.api.Location+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/Location', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.xml.example', + ], ], ], Response::HTTP_BAD_REQUEST => [ diff --git a/src/lib/Server/Controller/Location/LocationForContentListController.php b/src/lib/Server/Controller/Location/LocationForContentListController.php index 7235140cd..e2e23d502 100644 --- a/src/lib/Server/Controller/Location/LocationForContentListController.php +++ b/src/lib/Server/Controller/Location/LocationForContentListController.php @@ -16,25 +16,17 @@ #[Get( uriTemplate: '/content/objects/{contentId}/locations', openapi: new Model\Operation( + operationId: 'ibexa.rest.load_locations_for_content', summary: 'Get Locations for content item', description: 'Loads all Locations for the given content item.', tags: [ 'Objects', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the Location list is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -51,19 +43,20 @@ ], responses: [ Response::HTTP_OK => [ + 'description' => 'If set, the Location list is returned in XML or JSON format.', 'content' => [ - 'application/vnd.ibexa.api.LocationList+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/LocationList', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/GET/LocationList.xml.example', - ], 'application/vnd.ibexa.api.LocationList+json' => [ 'schema' => [ '$ref' => '#/components/schemas/LocationListWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/GET/LocationList.json.example', ], + 'application/vnd.ibexa.api.LocationList+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/LocationList', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/GET/LocationList.xml.example', + ], ], ], Response::HTTP_UNAUTHORIZED => [ diff --git a/src/lib/Server/Controller/Location/LocationLoadByPathController.php b/src/lib/Server/Controller/Location/LocationLoadByPathController.php index 1a3b8e47b..d223286c2 100644 --- a/src/lib/Server/Controller/Location/LocationLoadByPathController.php +++ b/src/lib/Server/Controller/Location/LocationLoadByPathController.php @@ -16,25 +16,17 @@ #[Get( uriTemplate: '/content/locations/{path}', openapi: new Model\Operation( + operationId: 'ibexa.rest.load_location', summary: 'Load Location', description: 'Loads the Location for the given path e.g. \'/content/locations/1/2/61\'.', tags: [ 'Location', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the new Location is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -51,18 +43,19 @@ ], responses: [ Response::HTTP_OK => [ + 'description' => 'If set, the new Location is returned in XML or JSON format.', 'content' => [ - 'application/vnd.ibexa.api.Location+xml' => [ + 'application/vnd.ibexa.api.Location+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/Location', + '$ref' => '#/components/schemas/LocationWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/path/GET/Location.json.example', ], - 'application/vnd.ibexa.api.Location+json' => [ + 'application/vnd.ibexa.api.Location+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/LocationWrapper', + '$ref' => '#/components/schemas/Location', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/path/GET/Location.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/Location/LocationRedirectController.php b/src/lib/Server/Controller/Location/LocationRedirectController.php index 2f1baa8f5..14e3fc2a7 100644 --- a/src/lib/Server/Controller/Location/LocationRedirectController.php +++ b/src/lib/Server/Controller/Location/LocationRedirectController.php @@ -17,35 +17,27 @@ #[Get( uriTemplate: '/content/locations', openapi: new Model\Operation( + operationId: 'ibexa.rest.redirect_location', summary: 'Load Locations by id/remoteId/urlAlias', description: 'Loads the Location for a given ID (x), remote ID or URL alias.', tags: [ 'Location', ], - parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - schema: [ - 'type' => 'string', - ], - ), - ], responses: [ Response::HTTP_OK => [ + 'description' => 'OK - returns the LocationList in XML or JSON format.', 'content' => [ - 'application/vnd.ibexa.api.LocationList+xml' => [ + 'application/vnd.ibexa.api.LocationList+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/Location', + '$ref' => '#/components/schemas/LocationWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/GET/LocationList.json.example', ], - 'application/vnd.ibexa.api.LocationList+json' => [ + 'application/vnd.ibexa.api.LocationList+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/LocationWrapper', + '$ref' => '#/components/schemas/Location', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/GET/LocationList.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/Location/LocationSubtreeDeleteController.php b/src/lib/Server/Controller/Location/LocationSubtreeDeleteController.php index 45951a6b3..74d6f783c 100644 --- a/src/lib/Server/Controller/Location/LocationSubtreeDeleteController.php +++ b/src/lib/Server/Controller/Location/LocationSubtreeDeleteController.php @@ -15,12 +15,22 @@ #[Delete( uriTemplate: '/content/locations/{path}', openapi: new Model\Operation( + operationId: 'ibexa.rest.delete_subtree', summary: 'Delete subtree', description: 'Deletes the complete subtree for the given path. Every content item which does not have any other Location is deleted. Otherwise the deleted Location is removed from the content item. The children are recursively deleted.', tags: [ 'Location', ], parameters: [ + new Model\Parameter( + name: 'X-CSRF-Token', + in: 'header', + required: true, + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', + schema: [ + 'type' => 'string', + ], + ), new Model\Parameter( name: 'path', in: 'path', diff --git a/src/lib/Server/Controller/Location/LocationUpdateController.php b/src/lib/Server/Controller/Location/LocationUpdateController.php index 5a91df551..0ade250c3 100644 --- a/src/lib/Server/Controller/Location/LocationUpdateController.php +++ b/src/lib/Server/Controller/Location/LocationUpdateController.php @@ -19,6 +19,7 @@ uriTemplate: '/content/locations/{path}', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.update_location', summary: 'Update Location', description: 'Updates the Location. This method can also be used to hide/reveal a Location via the hidden field in the LocationUpdate. PATCH or POST with header X-HTTP-Method-Override PATCH.', tags: [ @@ -26,19 +27,10 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the Location is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The LocationUpdate schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], @@ -62,35 +54,37 @@ ), ], requestBody: new Model\RequestBody( + description: 'The LocationUpdate schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.LocationUpdate+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/LocationUpdateStruct', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/location_id/PATCH/LocationUpdate.xml.example', - ], 'application/vnd.ibexa.api.LocationUpdate+json' => [ 'schema' => [ '$ref' => '#/components/schemas/LocationUpdateStructWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/location_id/PATCH/LocationUpdate.json.example', ], + 'application/vnd.ibexa.api.LocationUpdate+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/LocationUpdateStruct', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/location_id/PATCH/LocationUpdate.xml.example', + ], ]), ), responses: [ Response::HTTP_OK => [ + 'description' => 'If set, the Location is returned in XML or JSON format.', 'content' => [ - 'application/vnd.ibexa.api.Location+xml' => [ + 'application/vnd.ibexa.api.Location+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/Location', + '$ref' => '#/components/schemas/LocationWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/location_id/PATCH/Location.json.example', ], - 'application/vnd.ibexa.api.Location+json' => [ + 'application/vnd.ibexa.api.Location+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/LocationWrapper', + '$ref' => '#/components/schemas/Location', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/locations/POST/Location.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/locations/location_id/PATCH/Location.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateCreateController.php b/src/lib/Server/Controller/ObjectState/ObjectStateCreateController.php index df5bf4c8e..a2b05d20c 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateCreateController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateCreateController.php @@ -26,6 +26,7 @@ uriTemplate: '/content/objectstategroups/{objectStateGroupId}/objectstates', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.create_object_state', summary: 'Create Object state', description: 'Creates a new Object state.', tags: [ @@ -33,19 +34,10 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the new Object state is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The Object state input schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], @@ -60,36 +52,37 @@ ), ], requestBody: new Model\RequestBody( + description: 'The Object state input schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.ObjectStateCreate+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateCreate', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/POST/ObjectStateCreate.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateCreate+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateCreateWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/POST/ObjectStateCreate.json.example', ], + 'application/vnd.ibexa.api.ObjectStateCreate+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateCreate', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/POST/ObjectStateCreate.xml.example', + ], ]), ), responses: [ Response::HTTP_CREATED => [ 'description' => 'Object state created.', 'content' => [ - 'application/vnd.ibexa.api.ObjectState+xml' => [ + 'application/vnd.ibexa.api.ObjectState+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectState', + '$ref' => '#/components/schemas/ObjectStateWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/POST/ObjectState.json.example', ], - 'application/vnd.ibexa.api.ObjectState+json' => [ + 'application/vnd.ibexa.api.ObjectState+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateWrapper', + '$ref' => '#/components/schemas/ObjectState', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/POST/ObjectState.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateDeleteController.php b/src/lib/Server/Controller/ObjectState/ObjectStateDeleteController.php index c90d4917f..939948526 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateDeleteController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateDeleteController.php @@ -18,12 +18,22 @@ #[Delete( uriTemplate: '/content/objectstategroups/{objectStateGroupId}/objectstates/{objectStateId}', openapi: new Model\Operation( + operationId: 'ibexa.rest.delete_object_state', summary: 'Delete Object state', description: 'Deletes provided Object state.', tags: [ 'Object State Groups', ], parameters: [ + new Model\Parameter( + name: 'X-CSRF-Token', + in: 'header', + required: true, + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', + schema: [ + 'type' => 'string', + ], + ), new Model\Parameter( name: 'objectStateGroupId', in: 'path', diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateGroupCreateController.php b/src/lib/Server/Controller/ObjectState/ObjectStateGroupCreateController.php index 71d638157..613585243 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateGroupCreateController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateGroupCreateController.php @@ -25,6 +25,7 @@ uriTemplate: '/content/objectstategroups', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.create_object_state_group', summary: 'Create Object state group', description: 'Creates a new Object state group.', tags: [ @@ -32,55 +33,47 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the new Object state group is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The Object state group input schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], ), ], requestBody: new Model\RequestBody( + description: 'The Object state group input schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.ObjectStateGroupCreate+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroupCreate', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/POST/ObjectStateGroupCreate.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateGroupCreate+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateGroupCreateWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/POST/ObjectStateGroupCreate.json.example', ], + 'application/vnd.ibexa.api.ObjectStateGroupCreate+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateGroupCreate', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/POST/ObjectStateGroupCreate.xml.example', + ], ]), ), responses: [ Response::HTTP_CREATED => [ 'description' => 'Object state group created.', 'content' => [ - 'application/vnd.ibexa.api.ObjectStateGroup+xml' => [ + 'application/vnd.ibexa.api.ObjectStateGroup+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroup', + '$ref' => '#/components/schemas/ObjectStateGroupWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/POST/ObjectStateGroup.json.example', ], - 'application/vnd.ibexa.api.ObjectStateGroup+json' => [ + 'application/vnd.ibexa.api.ObjectStateGroup+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroupWrapper', + '$ref' => '#/components/schemas/ObjectStateGroup', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/POST/ObjectStateGroup.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateGroupDeleteController.php b/src/lib/Server/Controller/ObjectState/ObjectStateGroupDeleteController.php index bb4e695b9..714a736a7 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateGroupDeleteController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateGroupDeleteController.php @@ -18,12 +18,22 @@ #[Delete( uriTemplate: '/content/objectstategroups/{objectStateGroupId}', openapi: new Model\Operation( + operationId: 'ibexa.rest.delete_object_state_group', summary: 'Delete Object state group', description: 'Deletes the given Object state group including Object states.', tags: [ 'Object State Groups', ], parameters: [ + new Model\Parameter( + name: 'X-CSRF-Token', + in: 'header', + required: true, + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', + schema: [ + 'type' => 'string', + ], + ), new Model\Parameter( name: 'objectStateGroupId', in: 'path', diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateGroupListController.php b/src/lib/Server/Controller/ObjectState/ObjectStateGroupListController.php index 2d0a21389..0c790ddeb 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateGroupListController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateGroupListController.php @@ -21,25 +21,17 @@ uriTemplate: '/content/objectstategroups', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.load_object_state_groups', summary: 'List Object state groups', description: 'Returns a list of all Object state groups.', tags: [ 'Object State Groups', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the Object state group list is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -50,18 +42,18 @@ Response::HTTP_OK => [ 'description' => 'OK - returns a list of Object state groups.', 'content' => [ - 'application/vnd.ibexa.api.ObjectStateGroupList+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroupList', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/GET/ObjectStateGroupList.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateGroupList+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateGroupListWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/GET/ObjectStateGroupList.json.example', ], + 'application/vnd.ibexa.api.ObjectStateGroupList+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateGroupList', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/GET/ObjectStateGroupList.xml.example', + ], ], ], Response::HTTP_UNAUTHORIZED => [ diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateGroupLoadByIdController.php b/src/lib/Server/Controller/ObjectState/ObjectStateGroupLoadByIdController.php index 5f8bd351c..8ca06ddf4 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateGroupLoadByIdController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateGroupLoadByIdController.php @@ -19,25 +19,17 @@ #[Get( uriTemplate: '/content/objectstategroups/{objectStateGroupId}', openapi: new Model\Operation( + operationId: 'ibexa.rest.load_object_state_group', summary: 'Get Object state group', description: 'Returns the Object state group with the provided ID.', tags: [ 'Object State Groups', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the Object state group is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -56,17 +48,17 @@ Response::HTTP_OK => [ 'description' => 'OK - returns the Object state group.', 'content' => [ - 'application/vnd.ibexa.api.ObjectStateGroup+xml' => [ + 'application/vnd.ibexa.api.ObjectStateGroup+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroup', + '$ref' => '#/components/schemas/ObjectStateGroupWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/GET/ObjectStateGroup.json.example', ], - 'application/vnd.ibexa.api.ObjectStateGroup+json' => [ + 'application/vnd.ibexa.api.ObjectStateGroup+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroupWrapper', + '$ref' => '#/components/schemas/ObjectStateGroup', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/GET/ObjectStateGroup.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateGroupUpdateController.php b/src/lib/Server/Controller/ObjectState/ObjectStateGroupUpdateController.php index 0519b8873..2879cf67b 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateGroupUpdateController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateGroupUpdateController.php @@ -24,6 +24,7 @@ uriTemplate: '/content/objectstategroups/{objectStateGroupId}', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.update_object_state_group', summary: 'Update Object state group', description: 'Updates an Object state group. PATCH or POST with header X-HTTP-Method-Override PATCH.', tags: [ @@ -31,19 +32,10 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the updated Object state group is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The Object state group input schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], @@ -67,37 +59,38 @@ ), ], requestBody: new Model\RequestBody( + description: 'The Object state group input schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.ObjectStateGroupUpdate+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroupUpdate', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroupUpdate.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateGroupUpdate+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateGroupUpdateWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroupUpdate.json.example', ], + 'application/vnd.ibexa.api.ObjectStateGroupUpdate+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateGroupUpdate', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroupUpdate.xml.example', + ], ]), ), responses: [ Response::HTTP_OK => [ 'description' => 'OK - Object stated group updated.', 'content' => [ - 'application/vnd.ibexa.api.ObjectStateGroup+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateGroup', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateGroup+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateGroupWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.json.example', ], + 'application/vnd.ibexa.api.ObjectStateGroup+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateGroup', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/PATCH/ObjectStateGroup.xml.example', + ], ], ], Response::HTTP_BAD_REQUEST => [ diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateListController.php b/src/lib/Server/Controller/ObjectState/ObjectStateListController.php index 69938e9c6..7b2f948a0 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateListController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateListController.php @@ -21,25 +21,17 @@ uriTemplate: '/content/objectstategroups/{objectStateGroupId}/objectstates', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.load_object_states', summary: 'List Object states', description: 'Returns a list of all Object states of the given group.', tags: [ 'Object State Groups', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the Object state list is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -58,18 +50,18 @@ Response::HTTP_OK => [ 'description' => 'OK - returns a list of Object states.', 'content' => [ - 'application/vnd.ibexa.api.ObjectStateList+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateList', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/GET/ObjectStateList.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateList+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateListWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/GET/ObjectStateList.json.example', ], + 'application/vnd.ibexa.api.ObjectStateList+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateList', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/GET/ObjectStateList.xml.example', + ], ], ], Response::HTTP_UNAUTHORIZED => [ diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateLoadByIdController.php b/src/lib/Server/Controller/ObjectState/ObjectStateLoadByIdController.php index 169af848c..9b4785fc5 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateLoadByIdController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateLoadByIdController.php @@ -19,25 +19,17 @@ #[Get( uriTemplate: '/content/objectstategroups/{objectStateGroupId}/objectstates/{objectStateId}', openapi: new Model\Operation( + operationId: 'ibexa.rest.load_object_state', summary: 'Get Object state', description: 'Returns the Object state.', tags: [ 'Object State Groups', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the Object State is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -64,17 +56,17 @@ Response::HTTP_OK => [ 'description' => 'OK - returns the Object state.', 'content' => [ - 'application/vnd.ibexa.api.ObjectState+xml' => [ + 'application/vnd.ibexa.api.ObjectState+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectState', + '$ref' => '#/components/schemas/ObjectStateWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/GET/ObjectState.json.example', ], - 'application/vnd.ibexa.api.ObjectState+json' => [ + 'application/vnd.ibexa.api.ObjectState+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateWrapper', + '$ref' => '#/components/schemas/ObjectState', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/GET/ObjectState.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/ObjectState/ObjectStateUpdateController.php b/src/lib/Server/Controller/ObjectState/ObjectStateUpdateController.php index 3e985a6ea..d15c2bec4 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStateUpdateController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStateUpdateController.php @@ -25,6 +25,7 @@ uriTemplate: '/content/objectstategroups/{objectStateGroupId}/objectstates/{objectStateId}', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.update_object_state', summary: 'Update Object state', description: 'Updates an Object state. PATCH or POST with header X-HTTP-Method-Override PATCH.', tags: [ @@ -32,19 +33,10 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the updated Object state is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The Object state input schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], @@ -76,37 +68,38 @@ ), ], requestBody: new Model\RequestBody( + description: 'The Object state input schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.ObjectStateUpdate+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectStateUpdate', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectStateUpdate.xml.example', - ], 'application/vnd.ibexa.api.ObjectStateUpdate+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateUpdateWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectStateUpdate.json.example', ], + 'application/vnd.ibexa.api.ObjectStateUpdate+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectStateUpdate', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectStateUpdate.xml.example', + ], ]), ), responses: [ Response::HTTP_OK => [ 'description' => 'OK - Object State updated', 'content' => [ - 'application/vnd.ibexa.api.ObjectState+xml' => [ - 'schema' => [ - '$ref' => '#/components/schemas/ObjectState', - ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.xml.example', - ], 'application/vnd.ibexa.api.ObjectState+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ObjectStateWrapper', ], 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.json.example', ], + 'application/vnd.ibexa.api.ObjectState+xml' => [ + 'schema' => [ + '$ref' => '#/components/schemas/ObjectState', + ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objectstategroups/object_state_group_id/objectstates/object_state_id/PATCH/ObjectState.xml.example', + ], ], ], Response::HTTP_BAD_REQUEST => [ diff --git a/src/lib/Server/Controller/ObjectState/ObjectStatesForContentListController.php b/src/lib/Server/Controller/ObjectState/ObjectStatesForContentListController.php index 4cc2ab36e..ea0f07a66 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStatesForContentListController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStatesForContentListController.php @@ -22,25 +22,17 @@ uriTemplate: '/content/objects/{contentId}/objectstates', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.get_object_states_for_content', summary: 'Get Object states of content item', description: 'Returns the Object states of a content item', tags: [ 'Objects', ], parameters: [ - new Model\Parameter( - name: 'Accept', - in: 'header', - required: true, - description: 'If set, the Object states are returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), new Model\Parameter( name: 'If-None-Match', in: 'header', - required: true, + required: false, description: 'ETag', schema: [ 'type' => 'string', @@ -59,15 +51,17 @@ Response::HTTP_OK => [ 'description' => 'OK - returns the Object state.', 'content' => [ - 'application/vnd.ibexa.api.ContentObjectStates+xml' => [ + 'application/vnd.ibexa.api.ContentObjectStates+json' => [ 'schema' => [ '$ref' => '#/components/schemas/ContentObjectStates', ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/GET/ContentObjectStates.json.example', ], - 'application/vnd.ibexa.api.ContentObjectStates+json' => [ + 'application/vnd.ibexa.api.ContentObjectStates+xml' => [ 'schema' => [ '$ref' => '#/components/schemas/ContentObjectStates', ], + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/GET/ContentObjectStates.xml.example', ], ], ], diff --git a/src/lib/Server/Controller/ObjectState/ObjectStatesForContentUpdateController.php b/src/lib/Server/Controller/ObjectState/ObjectStatesForContentUpdateController.php index 3666e8dca..23417ea51 100644 --- a/src/lib/Server/Controller/ObjectState/ObjectStatesForContentUpdateController.php +++ b/src/lib/Server/Controller/ObjectState/ObjectStatesForContentUpdateController.php @@ -24,6 +24,7 @@ uriTemplate: '/content/objects/{contentId}/objectstates', extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false], openapi: new Model\Operation( + operationId: 'ibexa.rest.set_object_states_for_content', summary: 'Set Object states of content item', description: 'Updates Object states of a content item. An Object state in the input overrides the state of the Object state group. PATCH or POST with header X-HTTP-Method-Override PATCH.', tags: [ @@ -31,19 +32,10 @@ ], parameters: [ new Model\Parameter( - name: 'Accept', + name: 'X-CSRF-Token', in: 'header', required: true, - description: 'If set, the updated Object state is returned in XML or JSON format.', - schema: [ - 'type' => 'string', - ], - ), - new Model\Parameter( - name: 'Content-Type', - in: 'header', - required: true, - description: 'The content item Object states input schema encoded in XML or JSON format.', + description: 'The CSRF Token needed on all unsafe HTTP methods with session.', schema: [ 'type' => 'string', ], @@ -67,18 +59,19 @@ ), ], requestBody: new Model\RequestBody( + description: 'The content item Object states input schema encoded in XML or JSON format.', content: new \ArrayObject([ - 'application/vnd.ibexa.api.ContentObjectStates+xml' => [ + 'application/vnd.ibexa.api.ContentObjectStates+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/ContentObjectStates', + '$ref' => '#/components/schemas/ContentObjectStatesWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/PATCH/ContentObjectStates.response.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/PATCH/ContentObjectStates.request.json.example', ], - 'application/vnd.ibexa.api.ContentObjectStates+json' => [ + 'application/vnd.ibexa.api.ContentObjectStates+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/ContentObjectStatesWrapper', + '$ref' => '#/components/schemas/ContentObjectStates', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/GET/ContentObjectStates.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/PATCH/ContentObjectStates.request.xml.example', ], ]), ), @@ -86,17 +79,17 @@ Response::HTTP_NO_CONTENT => [ 'description' => 'OK - Object state updated.', 'content' => [ - 'application/vnd.ibexa.api.ContentObjectStates+xml' => [ + 'application/vnd.ibexa.api.ContentObjectStates+json' => [ 'schema' => [ - '$ref' => '#/components/schemas/ContentObjectStates', + '$ref' => '#/components/schemas/ContentObjectStatesWrapper', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/PATCH/ContentObjectStates.response.xml.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/PATCH/ContentObjectStates.response.json.example', ], - 'application/vnd.ibexa.api.ContentObjectStates+json' => [ + 'application/vnd.ibexa.api.ContentObjectStates+xml' => [ 'schema' => [ - '$ref' => '#/components/schemas/ContentObjectStatesWrapper', + '$ref' => '#/components/schemas/ContentObjectStates', ], - 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/GET/ContentObjectStates.json.example', + 'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/objectstates/PATCH/ContentObjectStates.response.xml.example', ], ], ],