Skip to content

Commit

Permalink
Remove nelmio, use zircote/swagger and swagger-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Apr 9, 2024
1 parent 85ace9e commit 8225d66
Show file tree
Hide file tree
Showing 59 changed files with 900 additions and 319 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"pimcore/static-resolver-bundle": "^1.3",
"pimcore/generic-data-index-bundle": "1.x-dev",
"pimcore/pimcore": "^11.0",
"nelmio/api-doc-bundle": "^4.2"
"zircote/swagger-php": "^4.8"
},
"require-dev": {
"pimcore/admin-ui-classic-bundle": "^v1.3",
Expand Down
40 changes: 0 additions & 40 deletions config/api/asset/collection.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions config/api/asset/get.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions config/api/login.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions config/api/refresh.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions config/api/schemas/credentials.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions config/api/schemas/refresh-token.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions config/api/schemas/token.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions config/api/schemas/translation.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions config/api/schemas/unauthorized.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions config/api/translation.yaml

This file was deleted.

5 changes: 1 addition & 4 deletions config/pimcore/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
imports:
- { resource: 'packages/nelmio_api_doc.yaml' }

pimcore:
translations:
domains:
- studio
- studio
20 changes: 0 additions & 20 deletions config/pimcore/packages/nelmio_api_doc.yaml

This file was deleted.

12 changes: 1 addition & 11 deletions config/pimcore/routing.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
api_docs:
path: /studio/api/docs
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

openapi_docs:
path: /studio/api/docs/openapi
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger }

studio_api:
resource: "../../src/Controller/Api"
type: annotation
prefix: /studio/api
options:
expose: true
expose: true
21 changes: 18 additions & 3 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,30 @@ services:
arguments:
$assetHydratorLocator: '@generic_data_index.asset_hydrator.service_locator'


# Assets
Pimcore\Bundle\StudioApiBundle\Service\AssetSearchServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\AssetSearchService

Pimcore\Bundle\StudioApiBundle\Service\GenericData\AssetSearchAdapterInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetSearchAdapter

Pimcore\Bundle\StudioApiBundle\Service\IconServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\IconService

Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProviderInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProvider

#Data Objects
Pimcore\Bundle\StudioApiBundle\Service\DataObjectSearchServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\DataObjectSearchService

Pimcore\Bundle\StudioApiBundle\Service\GenericData\DataObjectSearchAdapterInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\DataObjectSearchAdapter

Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\DataObjectQueryProviderInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\DataObjectQueryProvider

Pimcore\Bundle\StudioApiBundle\Service\IconServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\IconService

Pimcore\Bundle\StudioApiBundle\Service\TranslatorServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\TranslatorService

Expand All @@ -72,6 +84,9 @@ services:
Pimcore\Bundle\StudioApiBundle\Service\SecurityServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\SecurityService

Pimcore\Bundle\StudioApiBundle\Service\OpenApiServiceInterface:
class: Pimcore\Bundle\StudioApiBundle\Service\OpenApiService

#Voters
Pimcore\Bundle\StudioApiBundle\Security\Voter\AuthorizationVoter:
arguments: ['@request_stack']
Expand Down
29 changes: 29 additions & 0 deletions public/css/swagger-ui/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after {
box-sizing: inherit;
}

body {
margin: 0;
background: #fafafa;
}

#logo {
position: absolute;
top: 7px;
right: 10px;
width: 150px;
}

.header {
height: 55px;
background-color: #6428B4;
color: #fff;
}
3 changes: 3 additions & 0 deletions public/css/swagger-ui/swagger-ui.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/css/swagger-ui/swagger-ui.css.map

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions public/js/swagger-ui/swagger-initializer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
window.onload = function() {
//<editor-fold desc="Changeable Configuration Block">
const dataUrl = document.getElementById("swagger-ui").attributes["data-url"].value;
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
window.ui = SwaggerUIBundle({
url: dataUrl,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
});

//</editor-fold>
};
3 changes: 3 additions & 0 deletions public/js/swagger-ui/swagger-ui-bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/swagger-ui/swagger-ui-bundle.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/js/swagger-ui/swagger-ui-es-bundle-core.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/swagger-ui/swagger-ui-es-bundle-core.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/js/swagger-ui/swagger-ui-es-bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/swagger-ui/swagger-ui-es-bundle.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/js/swagger-ui/swagger-ui-standalone-preset.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/swagger-ui/swagger-ui-standalone-preset.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/js/swagger-ui/swagger-ui.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/swagger-ui/swagger-ui.js.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/Config/OpenApi/Security.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Pimcore\Bundle\StudioApiBundle\Config\OpenApi;

use OpenApi\Attributes\SecurityScheme;

#[SecurityScheme(
securityScheme: 'auth_token',
type: 'http',
description: 'Bearer token for authentication',
name: 'auth_token',
scheme: 'bearer'
)]
final class Security
{

}
Loading

0 comments on commit 8225d66

Please sign in to comment.