Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c428cb1
ContentLoadByIdController: Rm Accept header parameter
adriendupuis Aug 5, 2025
c23b5cf
ContentTypeLinkToGroupController.php: Describe `group` GET param
adriendupuis Sep 9, 2025
b6b7fc6
ContentLoadByIdController: Rm Accept header parameter
adriendupuis Aug 5, 2025
5ab7594
ContentTypeLinkToGroupController.php: Describe `group` GET param
adriendupuis Sep 9, 2025
c50b6cf
Merge remote-tracking branch 'origin/enh-openapi' into enh-openapi
adriendupuis Feb 18, 2026
cc4317c
Fix user session
adriendupuis Feb 18, 2026
d131ed2
JWT: The XML input and output aren't supported since #101
adriendupuis Mar 25, 2026
94a3c25
ContentLoadByIdController: Rm Accept header parameter
adriendupuis Aug 5, 2025
c53c70d
ContentTypeLinkToGroupController.php: Describe `group` GET param
adriendupuis Sep 9, 2025
ab98fd2
Fix user session
adriendupuis Feb 18, 2026
22843ab
JWT: The XML input and output aren't supported since #101
adriendupuis Mar 25, 2026
f1d7b0e
Merge remote-tracking branch 'origin/enh-openapi' into enh-openapi
adriendupuis Mar 26, 2026
4ebf91d
Fix REST ApiPlatform/OpenApi doc
adriendupuis Apr 22, 2026
bf62b00
JWT: add response description
adriendupuis Apr 22, 2026
b776a58
Sort mime types
adriendupuis Apr 22, 2026
1b9afe8
JWT: Update requestBody description
adriendupuis Apr 22, 2026
9ee5a1f
ContentCreateController: Add X-CSRF-Token and ContentInfo+json
adriendupuis Apr 29, 2026
1cea8ae
ContentMetadataUpdateController: Add CSRF, use existing examples
adriendupuis Apr 29, 2026
790a2e0
Add CSRF token to all unsafe methods
adriendupuis Apr 29, 2026
f1d4b37
rm SessionController.php empty file
adriendupuis Apr 30, 2026
4155f75
rm RestAuthenticator.php empty file
adriendupuis Apr 30, 2026
f4876d2
rm AuthorizationHeaderRESTRequestMatcher.php empty file
adriendupuis Apr 30, 2026
5c1b76c
Fix x-ibexa-example-file
adriendupuis Apr 30, 2026
62a06d6
Fix x-ibexa-example-file
adriendupuis May 4, 2026
1adcc6e
Fix x-ibexa-example-file
adriendupuis May 4, 2026
219db0b
Fix x-ibexa-example-file
adriendupuis May 4, 2026
17b4d02
Views.php: Use existing example
adriendupuis May 5, 2026
cd818f0
Merge branch '5.0' into enh-openapi
adriendupuis May 6, 2026
676c67b
roles_schemas.yml: Fix required
adriendupuis May 7, 2026
7731cf0
BookmarkIsBookmarkedController: Better param & response descriptions
adriendupuis May 11, 2026
f1314bf
Add operationId
adriendupuis May 11, 2026
8f7b2a0
BookmarkIsBookmarkedController w/ GET
adriendupuis May 11, 2026
9863520
BookmarkCreatedController: requestBody before responses
adriendupuis May 11, 2026
3adaf49
Controller: requestBody before responses
adriendupuis May 11, 2026
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"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"UserGroupRefList": {
"_media-type": "application/vnd.ibexa.api.UserGroupRefList+json",
"_href": "/api/ibexa/v2/user/users/57/groups",
"UserGroup": [
{
"_media-type": "application/vnd.ibexa.api.UserGroup+json",
"_href": "/api/ibexa/v2/user/groups/1/5/13"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<UserGroupRefList media-type="application/vnd.ibexa.api.UserGroupRefList+xml" href="/api/ibexa/v2/user/users/115/groups">
<UserGroup media-type="application/vnd.ibexa.api.UserGroup+xml" href="/api/ibexa/v2/user/groups/1/5/12">
<unassign href="/api/ibexa/v2/user/users/79/groups/12" method="DELETE"/>
</UserGroup>
<UserGroup media-type="application/vnd.ibexa.api.UserGroup+xml" href="/api/ibexa/v2/user/groups/1/5/13">
<unassign href="/api/ibexa/v2/user/users/115/groups/13" method="DELETE"/>
</UserGroup>
</UserGroupRefList>
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ schemas:
description: A read-only list of IDs or identifiers for which the limitation should be applied. The value of this property must conform to a hash, which means that it may only consist of array and scalar values, but must not contain objects or resources.
type: object
required:
- $ref
- ref
properties:
ref:
type: array
Expand Down
Empty file.
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.3)

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.4)

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
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
Loading
Loading