Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
],
],
],
Expand Down
40 changes: 17 additions & 23 deletions src/lib/Server/Controller/Location/LocationCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,18 @@
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: [
'Objects',
],
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',
],
Expand All @@ -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 => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
],
],
],
Expand Down
24 changes: 8 additions & 16 deletions src/lib/Server/Controller/Location/LocationRedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
40 changes: 17 additions & 23 deletions src/lib/Server/Controller/Location/LocationUpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,18 @@
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: [
'Location',
],
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',
],
Expand All @@ -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',
],
],
],
Expand Down
Loading
Loading