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
17 changes: 14 additions & 3 deletions src/lib/Server/Controller/Bookmark/BookmarkCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,22 @@
uriTemplate: '/bookmark/{locationId}',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.create_bookmark',
summary: 'Create bookmark',
description: 'Add given Location to bookmarks of the current user.',
tags: [
'Bookmark',
],
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: 'locationId',
in: 'path',
Expand All @@ -38,6 +48,10 @@
],
),
],
requestBody: new Model\RequestBody(
description: 'No payload required',
content: new \ArrayObject(),
),
responses: [
Response::HTTP_CREATED => [
'description' => 'Created.',
Expand All @@ -52,9 +66,6 @@
'description' => 'Error - Location is already bookmarked.',
],
],
requestBody: new Model\RequestBody(
content: new \ArrayObject(),
),
),
)]
class BookmarkCreateController extends RestController
Expand Down
10 changes: 10 additions & 0 deletions src/lib/Server/Controller/Bookmark/BookmarkDeleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,22 @@
#[Delete(
uriTemplate: '/bookmark/{locationId}',
openapi: new Model\Operation(
operationId: 'ibexa.rest.delete_bookmark',
summary: 'Delete bookmark',
description: 'Deletes the given Location from bookmarks of the current user.',
tags: [
'Bookmark',
],
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: 'locationId',
in: 'path',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Ibexa\Rest\Server\Controller\Bookmark;

use ApiPlatform\OpenApi\Model;
use Ibexa\Bundle\Rest\ApiPlatform\Get;
use Ibexa\Bundle\Rest\ApiPlatform\Head;
use Ibexa\Contracts\Core\Repository\BookmarkService;
use Ibexa\Contracts\Core\Repository\LocationService;
Expand All @@ -20,6 +21,7 @@
#[Head(
uriTemplate: '/bookmark/{locationId}',
openapi: new Model\Operation(
operationId: 'ibexa.rest.is_bookmarked.head',
summary: 'Check if Location is bookmarked',
description: 'Checks if the given Location is bookmarked by the current user.',
tags: [
Expand All @@ -31,19 +33,51 @@
in: 'path',
required: true,
schema: [
'type' => 'string',
'type' => 'integer',
],
),
],
responses: [
Response::HTTP_OK => [
'description' => 'OK - bookmarked.',
'description' => 'OK - the given Location is bookmarked.',
],
Response::HTTP_UNAUTHORIZED => [
'description' => 'Error - the user is not authorized for the given Location.',
],
Response::HTTP_NOT_FOUND => [
'description' => 'Error - the given Location does not exist / is not bookmarked.',
'description' => 'Error - the given Location is not bookmarked or does not exist.',
],
],
),
)]
#[Get(

Check failure on line 53 in src/lib/Server/Controller/Bookmark/BookmarkIsBookmarkedController.php

View workflow job for this annotation

GitHub Actions / Unit & integration tests (8.4)

Attribute class Ibexa\Bundle\Rest\ApiPlatform\Get does not exist.

Check failure on line 53 in src/lib/Server/Controller/Bookmark/BookmarkIsBookmarkedController.php

View workflow job for this annotation

GitHub Actions / Unit & integration tests (8.3)

Attribute class Ibexa\Bundle\Rest\ApiPlatform\Get does not exist.
uriTemplate: '/bookmark/{locationId}',
openapi: new Model\Operation(
operationId: 'ibexa.rest.is_bookmarked.get',
summary: 'Check if Location is bookmarked',
description: 'Checks if the given Location is bookmarked by the current user.',
tags: [
'Bookmark',
],
parameters: [
new Model\Parameter(
name: 'locationId',
in: 'path',
required: true,
schema: [
'type' => 'integer',
],
),
],
responses: [
Response::HTTP_OK => [
'description' => 'OK - the given Location is bookmarked.',
],
Response::HTTP_UNAUTHORIZED => [
'description' => 'Error - the user is not authorized for the given Location.',
],
Response::HTTP_NOT_FOUND => [
'description' => 'Error - the given Location is not bookmarked or does not exist.',
],
],
),
Expand Down
25 changes: 8 additions & 17 deletions src/lib/Server/Controller/Bookmark/BookmarkListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,28 @@
uriTemplate: '/bookmark',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.load_bookmarks',
summary: 'List of bookmarks',
description: 'Lists bookmarked Locations for the current user.',
tags: [
'Bookmark',
],
parameters: [
new Model\Parameter(
name: 'Accept',
in: 'header',
required: true,
description: 'If set, the list is returned in XML or JSON format.',
schema: [
'type' => 'string',
],
),
],
responses: [
Response::HTTP_OK => [
'description' => 'If set, the list is returned in XML or JSON format.',
'content' => [
'application/vnd.ibexa.api.BookmarkList+xml' => [
'schema' => [
'$ref' => '#/components/schemas/BookmarkList',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/bookmark/GET/BookmarkList.xml.example',
],
'application/vnd.ibexa.api.BookmarkList+json' => [
'schema' => [
'$ref' => '#/components/schemas/BookmarkListWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/bookmark/GET/BookmarkList.json.example',
],
'application/vnd.ibexa.api.BookmarkList+xml' => [
'schema' => [
'$ref' => '#/components/schemas/BookmarkList',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/bookmark/GET/BookmarkList.xml.example',
],
],
],
Response::HTTP_UNAUTHORIZED => [
Expand Down
25 changes: 8 additions & 17 deletions src/lib/Server/Controller/Language/LanguageListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,28 @@
uriTemplate: '/languages',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.languages.list',
summary: 'Language list',
description: 'Lists languages',
tags: [
'Language',
],
parameters: [
new Model\Parameter(
name: 'Accept',
in: 'header',
required: true,
description: 'If set, the list is returned in XML or JSON format.',
schema: [
'type' => 'string',
],
),
],
responses: [
Response::HTTP_OK => [
'description' => 'If set, the list is returned in XML or JSON format.',
'content' => [
'application/vnd.ibexa.api.LanguageList+xml' => [
'schema' => [
'$ref' => '#/components/schemas/LanguageList',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/languages/GET/LanguageList.xml.example',
],
'application/vnd.ibexa.api.LanguageList+json' => [
'schema' => [
'$ref' => '#/components/schemas/LanguageListWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/languages/GET/LanguageList.json.example',
],
'application/vnd.ibexa.api.LanguageList+xml' => [
'schema' => [
'$ref' => '#/components/schemas/LanguageList',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/languages/GET/LanguageList.xml.example',
],
],
],
],
Expand Down
23 changes: 8 additions & 15 deletions src/lib/Server/Controller/Language/LanguageLoadByIdController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,12 @@
uriTemplate: '/languages/{code}',
extraProperties: [OpenApiFactory::OVERRIDE_OPENAPI_RESPONSES => false],
openapi: new Model\Operation(
operationId: 'ibexa.rest.languages.view',
summary: 'Get language',
tags: [
'Language',
],
parameters: [
new Model\Parameter(
name: 'Accept',
in: 'header',
required: true,
description: 'If set, the language is returned in XML or JSON format.',
schema: [
'type' => 'string',
],
),
new Model\Parameter(
name: 'code',
in: 'path',
Expand All @@ -45,19 +37,20 @@
],
responses: [
Response::HTTP_OK => [
'description' => 'If set, the language is returned in XML or JSON format.',
'content' => [
'application/vnd.ibexa.api.Language+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Language',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/languages/code/GET/Language.xml.example',
],
'application/vnd.ibexa.api.Language+json' => [
'schema' => [
'$ref' => '#/components/schemas/LanguageWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/languages/code/GET/Language.json.example',
],
'application/vnd.ibexa.api.Language+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Language',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/languages/code/GET/Language.xml.example',
],
],
],
],
Expand Down
25 changes: 8 additions & 17 deletions src/lib/Server/Controller/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,28 @@
#[Get(
uriTemplate: '/',
openapi: new Model\Operation(
operationId: 'ibexa.rest.load_root_resource',
summary: 'List of root resources',
description: 'Lists the root resources of the Ibexa Platform installation.',
tags: [
'Root',
],
parameters: [
new Model\Parameter(
name: 'Accept',
in: 'header',
required: true,
description: 'If set, the list is return in XML or JSON format.',
schema: [
'type' => 'string',
],
),
],
responses: [
Response::HTTP_OK => [
'description' => 'If set, the list is return in XML or JSON format.',
'content' => [
'application/vnd.ibexa.api.Root+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Root',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/GET/Root.xml.example',
],
'application/vnd.ibexa.api.Root+json' => [
'schema' => [
'$ref' => '#/components/schemas/RootWrapper',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/GET/Root.json.example',
],
'application/vnd.ibexa.api.Root+xml' => [
'schema' => [
'$ref' => '#/components/schemas/Root',
],
'x-ibexa-example-file' => '@IbexaRestBundle/Resources/api_platform/examples/GET/Root.xml.example',
],
],
],
],
Expand Down
Loading
Loading