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
@@ -0,0 +1,43 @@
{
"Content": {
"_media-type": "application/vnd.ibexa.api.ContentInfo+json",
"_href": "/api/ibexa/v2/content/objects/77",
"_remoteId": "89e9b86c673b1c1de6781bb94488b18c",
"_id": 77,
"ContentType": {
"_media-type": "application/vnd.ibexa.api.ContentType+json",
"_href": "/api/ibexa/v2/content/types/2"
},
"Name": "draft article",
"TranslatedName": "draft article",
"Versions": {
"_media-type": "application/vnd.ibexa.api.VersionList+json",
"_href": "/api/ibexa/v2/content/objects/77/versions"
},
"CurrentVersion": {
"_media-type": "application/vnd.ibexa.api.Version+json",
"_href": "/api/ibexa/v2/content/objects/77/currentversion"
},
"Section": {
"_media-type": "application/vnd.ibexa.api.Section+json",
"_href": "/api/ibexa/v2/content/sections/1"
},
"Locations": {
"_media-type": "application/vnd.ibexa.api.LocationList+json",
"_href": "/api/ibexa/v2/content/objects/77/locations"
},
"Owner": {
"_media-type": "application/vnd.ibexa.api.User+json",
"_href": "/api/ibexa/v2/user/users/14"
},
"mainLanguageCode": "eng-GB",
"currentVersionNo": 1,
"alwaysAvailable": true,
"isHidden": false,
"status": "DRAFT",
"ObjectStates": {
"_media-type": "application/vnd.ibexa.api.ContentObjectStates+json",
"_href": "/api/ibexa/v2/content/objects/77/objectstates"
}
}
}
46 changes: 23 additions & 23 deletions src/lib/Server/Controller/Content/ContentCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,67 +27,67 @@
uriTemplate: '/content/objects',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.create_content',
summary: 'Create content item',
description: 'Creates a draft assigned to the authenticated user. If a different user ID is given in the input, the draft is assigned to the given user but this action requires special permissions for the authenticated user (this is useful for content staging where the transfer process does not have to authenticate with the user who created the content item in the source server). The user needs to publish the content item if it should be visible.',
tags: [
'Objects',
],
parameters: [
new Model\Parameter(
name: 'Accept',
name: 'X-CSRF-Token',
in: 'header',
required: true,
description: 'Content - If set, all information for the content item including the embedded current version is returned in XML or JSON format. ContentInfo - If set, all information for the content item (excluding the current version) is returned in XML or JSON format.',
schema: [
'type' => 'string',
],
),
new Model\Parameter(
name: 'Content-Type',
in: 'header',
required: true,
description: 'The ContentCreate 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 ContentCreate schema encoded in XML or JSON format.',
content: new \ArrayObject([
'application/vnd.ibexa.api.ContentCreate+xml' => [
'schema' => [
'$ref' => '#/components/schemas/ContentCreate',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/ContentCreate.xml.example',
],
'application/vnd.ibexa.api.ContentCreate+json' => [
'schema' => [
'$ref' => '#/components/schemas/ContentCreateWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/ContentCreate.json.example',
],
'application/vnd.ibexa.api.ContentCreate+xml' => [
'schema' => [
'$ref' => '#/components/schemas/ContentCreate',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/ContentCreate.xml.example',
],
]),
),
responses: [
Response::HTTP_CREATED => [
'description' => 'Content - If set, all information for the content item including the embedded current version is returned in XML or JSON format. ContentInfo - If set, all information for the content item (excluding the current version) is returned in XML or JSON format.',
'content' => [
'application/vnd.ibexa.api.Content+json' => [
'schema' => [
'$ref' => '#/components/schemas/ContentWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/Content.json.example',
],
'application/vnd.ibexa.api.Content+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Content',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/GET/Content.xml.example',
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/Content.xml.example',
],
'application/vnd.ibexa.api.Content+json' => [
'application/vnd.ibexa.api.ContentInfo+json' => [
'schema' => [
'$ref' => '#/components/schemas/ContentWrapper',
'$ref' => '#/components/schemas/ContentInfoWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/GET/Content.json.example',
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/ContentInfo.json.example',
],
'application/vnd.ibexa.api.ContentInfo+xml' => [
'schema' => [
'$ref' => '#/components/schemas/ContentInfoWrapper',
'$ref' => '#/components/schemas/ContentInfo',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/PATCH/ContentInfo.xml.example',
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/POST/ContentInfo.xml.example',
],
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#[Get(
uriTemplate: '/content/objects/{contentId}/currentversion',
openapi: new Model\Operation(
operationId: 'ibexa.rest.redirect_current_version',
summary: 'Get current version',
description: 'Redirects to the current version of the content item.',
tags: [
Expand All @@ -33,18 +34,19 @@
],
responses: [
Response::HTTP_OK => [
'description' => 'OK - returns the Version in XML or JSON format.',
'content' => [
'application/vnd.ibexa.api.Version+xml' => [
'application/vnd.ibexa.api.Version+json' => [
'schema' => [
'$ref' => '#/components/schemas/Version',
'$ref' => '#/components/schemas/VersionWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.xml.example',
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/currentversion/GET/Version.json.example',
],
'application/vnd.ibexa.api.Version+json' => [
'application/vnd.ibexa.api.Version+xml' => [
'schema' => [
'$ref' => '#/components/schemas/VersionWrapper',
'$ref' => '#/components/schemas/Version',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.json.example',
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/currentversion/GET/Version.xml.example',
],
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
uriTemplate: '/content/objects/{contentId}/relations',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.redirect_current_version_relations',
summary: 'Load Relations of content item',
description: 'Redirects to the Relations of the current version.',
tags: [
Expand Down
10 changes: 10 additions & 0 deletions src/lib/Server/Controller/Content/ContentDeleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@
#[Delete(
uriTemplate: '/content/objects/{contentId}',
openapi: new Model\Operation(
operationId: 'ibexa.rest.delete_content',
summary: 'Delete Content',
description: 'Deletes content item. If content item has multiple Locations, all of them will be deleted via delete a subtree.',
tags: [
'Objects',
],
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: 'contentId',
in: 'path',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@
uriTemplate: '/content/objects/{contentId}/currentversion',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.content.create_draft_from_current_version',
summary: 'Create a draft from current version',
description: 'The system creates a new draft as a copy of the current version. COPY or POST with header X-HTTP-Method-Override COPY.',
tags: [
'Objects',
],
parameters: [
new Model\Parameter(
name: 'Accept',
name: 'X-CSRF-Token',
in: 'header',
required: true,
description: 'If set, the updated version is returned in XML or JSON format.',
description: 'The CSRF Token needed on all unsafe HTTP methods with session.',
schema: [
'type' => 'string',
],
Expand All @@ -45,22 +46,26 @@
],
),
],
requestBody: new Model\RequestBody(
description: 'No payload required',
content: new \ArrayObject(),
),
responses: [
Response::HTTP_CREATED => [
'description' => 'Created',
'content' => [
'application/vnd.ibexa.api.Version+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Version',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.xml.example',
],
'application/vnd.ibexa.api.Version+json' => [
'schema' => [
'$ref' => '#/components/schemas/VersionWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.json.example',
],
'application/vnd.ibexa.api.Version+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Version',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.xml.example',
],
],
],
Response::HTTP_UNAUTHORIZED => [
Expand All @@ -73,9 +78,6 @@
'description' => 'Error - the content item was not found.',
],
],
requestBody: new Model\RequestBody(
content: new \ArrayObject(),
),
),
)]
class ContentDraftCreateFromCurrentVersionController extends RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@
uriTemplate: '/content/objects/{contentId}/versions/{versionNo}',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.content.create_draft_from_version',
summary: 'Create a draft from a version',
description: 'The system creates a new draft as a copy of the given version. COPY or POST with header X-HTTP-Method-Override COPY.',
tags: [
'Objects',
],
parameters: [
new Model\Parameter(
name: 'Accept',
name: 'X-CSRF-Token',
in: 'header',
required: true,
description: 'If set, the updated version is returned in XML or JSON format.',
description: 'The CSRF Token needed on all unsafe HTTP methods with session.',
schema: [
'type' => 'string',
],
Expand All @@ -51,22 +52,26 @@
],
),
],
requestBody: new Model\RequestBody(
description: 'No payload required',
content: new \ArrayObject(),
),
responses: [
Response::HTTP_CREATED => [
'description' => 'Created.',
'content' => [
'application/vnd.ibexa.api.Version+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Version',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.xml.example',
],
'application/vnd.ibexa.api.Version+json' => [
'schema' => [
'$ref' => '#/components/schemas/VersionWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.json.example',
],
'application/vnd.ibexa.api.Version+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Version',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/content/objects/content_id/versions/version_no/GET/Version.xml.example',
],
],
],
Response::HTTP_UNAUTHORIZED => [
Expand All @@ -76,9 +81,6 @@
'description' => 'Error - the content item was not found.',
],
],
requestBody: new Model\RequestBody(
content: new \ArrayObject(),
),
),
)]
class ContentDraftCreateFromVersionController extends RestController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,22 @@
#[Delete(
uriTemplate: '/content/objects/{contentId}/versions/{versionNo}/translations/{languageCode}',
openapi: new Model\Operation(
operationId: 'ibexa.rest.delete_translation_from_draft',
summary: 'Delete translation from version draft',
description: 'Removes a translation from a version draft.',
tags: [
'Objects',
],
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: 'contentId',
in: 'path',
Expand Down
17 changes: 14 additions & 3 deletions src/lib/Server/Controller/Content/ContentHideController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,22 @@
uriTemplate: '/content/objects/{contentId}/hide',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.hide_content',
summary: 'Hide content item',
description: 'Makes or keep the content item invisible',
tags: [
'Objects',
],
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: 'contentId',
in: 'path',
Expand All @@ -33,6 +43,10 @@
],
),
],
requestBody: new Model\RequestBody(
description: 'No payload required',
content: new \ArrayObject(),
),
responses: [
Response::HTTP_NO_CONTENT => [
'description' => 'OK - Object item is hidden.',
Expand All @@ -44,9 +58,6 @@
'description' => 'Error - The content item was not found.',
],
],
requestBody: new Model\RequestBody(
content: new \ArrayObject(),
),
),
)]
class ContentHideController extends RestController
Expand Down
Loading
Loading