Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit a198577

Browse files
authored
refactor: simplify the API documentation page (#323)
This will correct the API documentation and simplify the code base. See also: * https://www.drupal.org/node/3000458 * https://www.drupal.org/node/3000609
1 parent 27ae0f4 commit a198577

6 files changed

Lines changed: 20 additions & 194 deletions

File tree

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434
"type:drupal-drush"
3535
]
3636
},
37-
"patches": {}
37+
"patches": {
38+
"drupal/openapi": {
39+
"Exclude disabled JSON API resources": "https://www.drupal.org/files/issues/2018-09-18/3000458--exclude-disabled-resource-types--2.patch",
40+
"Documentation for JSON API collections needs minor adjustments": "https://www.drupal.org/files/issues/2018-09-18/3000609--jsonapi-collections-fixes--2.patch"
41+
}
42+
}
3843
},
3944
"require": {
4045
"cweagans/composer-patches": "^1.6.0",

modules/contenta_enhancements/contenta_enhancements.info.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ core: 8.x
44
type: module
55
dependencies:
66
- simple_oauth
7+
- openapi

modules/contenta_enhancements/contenta_enhancements.links.task.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

modules/contenta_enhancements/contenta_enhancements.routing.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
contenta_enhancements.api:
22
path: '/admin/api'
33
defaults:
4-
_controller: '\Drupal\contenta_enhancements\Controller\OpenApiDocs::generateDocs'
5-
entity_mode: 'content_entities'
6-
methods: [GET]
7-
requirements:
8-
_permission: 'access openapi api docs'
9-
10-
contenta_enhancements.api.config:
11-
path: '/admin/api/config'
12-
defaults:
13-
_controller: '\Drupal\contenta_enhancements\Controller\OpenApiDocs::generateDocs'
14-
entity_mode: 'config_entities'
15-
methods: [GET]
4+
_title: 'OpenAPI Documentation'
5+
_controller: '\Drupal\openapi\Controller\OpenApiUiController::generate'
6+
openapi_ui: redoc
7+
openapi_generator: jsonapi
8+
methods:
9+
- GET
1610
requirements:
1711
_permission: 'access openapi api docs'
12+
_module_dependencies: 'openapi_ui'
13+
options:
14+
parameters:
15+
openapi_ui:
16+
type: openapi_ui
17+
openapi_generator:
18+
type: openapi_generator
1819

1920
contenta_enhancements.revert:
2021
path: '/admin/contenta/revert'

modules/contenta_enhancements/src/Controller/ApiAuthInfo.php

Lines changed: 0 additions & 63 deletions
This file was deleted.

modules/contenta_enhancements/src/Controller/OpenApiDocs.php

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)