Skip to content

Commit

Permalink
Rename stoplightio to stopligt
Browse files Browse the repository at this point in the history
  • Loading branch information
DjordyKoert committed Feb 14, 2025
1 parent 57114be commit 4a0b7eb
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CHANGELOG

## 4.37.0
* Added Stoplightio as an alternative UI option. https://stoplight.io/open-source/elements.
* Added Stoplight as an alternative UI option. https://stoplight.io/open-source/elements.

## 4.36.1
- Passing an array key `value` with a list of strings to the `Areas` annotation/attribute is deprecated. Pass the list of strings directly.
Expand Down
4 changes: 2 additions & 2 deletions config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<argument type="string">redocly</argument>
</service>

<service id="nelmio_api_doc.controller.stoplightio" class="Nelmio\ApiDocBundle\Controller\SwaggerUiController" public="true">
<service id="nelmio_api_doc.controller.stoplight" class="Nelmio\ApiDocBundle\Controller\SwaggerUiController" public="true">
<argument type="service" id="nelmio_api_doc.render_docs" />
<argument type="string">stoplightio</argument>
<argument type="string">stoplight</argument>
</service>

<service id="nelmio_api_doc.controller.swagger" alias="nelmio_api_doc.controller.swagger_json" public="true" />
Expand Down
6 changes: 3 additions & 3 deletions docs/areas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ Then update your routing to be able to access your different documentations:
# methods: GET
# defaults: { _controller: nelmio_api_doc.controller.redocly, area: default }
# With Stoplightio
# With Stoplight
# app/config/routing.yaml
#app.stoplightio:
#app.stoplight:
# path: /api/doc/{area}
# methods: GET
# defaults: { _controller: nelmio_api_doc.controller.stoplightio, area: default }
# defaults: { _controller: nelmio_api_doc.controller.stoplight, area: default }
# To expose them as JSON
#app.swagger.areas:
Expand Down
2 changes: 1 addition & 1 deletion docs/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ or configure UI configuration, use the ``--html-config`` option.
- ``swagger_ui_config`` - `configure Swagger UI`_
- ``"supportedSubmitMethods":[]`` disables the sandbox
- ``redocly_config`` - `configure Redocly`_
- ``stoplightio_config`` - `configure Stoplightio`_
- ``stoplight_config`` - `configure Stoplight`_

.. code-block:: bash
Expand Down
8 changes: 4 additions & 4 deletions docs/configuration_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The bundle configuration is stored under the ``nelmio_api_doc`` key in your appl
# https://redocly.com/docs/redoc/config/
redocly_config: []
# https://docs.stoplight.io/docs/elements/b074dc47b2826-elements-configuration-options
stoplightio_config: []
stoplight_config: []
# Filter the routes that are documented
areas:
default:
Expand Down Expand Up @@ -159,7 +159,7 @@ html_config

**type**: ``dictionary``
**default**: ``[]``
**allowed keys**: ``assets_mode``, ``swagger_ui_config``, ``redocly_config``, ``stoplightio_config``
**allowed keys**: ``assets_mode``, ``swagger_ui_config``, ``redocly_config``, ``stoplight_config``

UI configuration options.

Expand All @@ -175,11 +175,11 @@ UI configuration options.
# https://redocly.com/docs/redoc/config/
redocly_config: []
# https://docs.stoplight.io/docs/elements/b074dc47b2826-elements-configuration-options
stoplightio_config: []
stoplight_config: []
.. versionadded:: 4.37

The `stoplightio_config` option was added in 4.37.
The `stoplight_config` option was added in 4.37.

areas
~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ By default, only routes under ``/api`` are documented. Update the regexp at ``ne
.. code-block:: yaml
# config/routes.yaml
app.stoplightio:
app.stoplight:
path: /api/doc
methods: GET
defaults: { _controller: nelmio_api_doc.controller.stoplightio }
defaults: { _controller: nelmio_api_doc.controller.stoplight }
If you also want to expose it in JSON, register this route:

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Command/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DumpCommand extends Command
'assets_mode' => AssetsMode::CDN,
'swagger_ui_config' => [],
'redocly_config' => [],
'stoplightio_config' => [],
'stoplight_config' => [],
];

public function __construct(RenderOpenApi $renderOpenApi)
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->addDefaultsIfNotSet()
->ignoreExtraKeys(false)
->end()
->arrayNode('stoplightio_config')
->arrayNode('stoplight_config')
->info('https://docs.stoplight.io/docs/elements/b074dc47b2826-elements-configuration-options')
->addDefaultsIfNotSet()
->ignoreExtraKeys(false)
Expand Down
6 changes: 3 additions & 3 deletions src/Render/Html/HtmlOpenApiRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ public function render(OpenApi $spec, array $options = []): string
);
}

if (isset($options['ui_renderer']) && Renderer::STOPLIGHTIO === $options['ui_renderer']) {
if (isset($options['ui_renderer']) && Renderer::STOPLIGHT === $options['ui_renderer']) {
return $this->twig->render(
'@NelmioApiDoc/Stoplightio/index.html.twig',
'@NelmioApiDoc/Stoplight/index.html.twig',
[
'swagger_data' => ['spec' => json_decode($spec->toJson(), true)],
'assets_mode' => $options['assets_mode'],
'stoplightio_config' => $options['stoplightio_config'],
'stoplight_config' => $options['stoplight_config'],
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Render/Html/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class Renderer
{
public const REDOCLY = 'redocly';
public const SWAGGERUI = 'swaggerui';
public const STOPLIGHTIO = 'stoplightio';
public const STOPLIGHT = 'stoplight';
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<title>{% block title %}{{ swagger_data.spec.info.title }}{% endblock title %}</title>

{% block javascripts %}
{{ nelmioAsset(assets_mode, 'stoplightio/web-components.min.js') }}
{{ nelmioAsset(assets_mode, 'stoplight/web-components.min.js') }}
{% endblock javascripts %}
{% block stylesheets %}
{{ nelmioAsset(assets_mode, 'stoplightio/styles.min.css') }}
{{ nelmioAsset(assets_mode, 'stoplight/styles.min.css') }}
{% endblock stylesheets %}
</head>
<body>
Expand All @@ -24,7 +24,7 @@
docs.apiDescriptionDocument = {{ swagger_data|json_encode(65)|raw }}.spec;
const config = {{ stoplightio_config|json_encode(65)|raw }};
const config = {{ stoplight_config|json_encode(65)|raw }};
Object.keys(config).forEach(key => {
docs[key] = config[key];
Expand Down
6 changes: 3 additions & 3 deletions tests/Command/DumpCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ public static function provideAssetsMode(): \Generator
'"hideDownloadButton":true',
];

yield 'configure stoplightio' => [
yield 'configure stoplight' => [
[
'ui_renderer' => Renderer::STOPLIGHTIO,
'ui_renderer' => Renderer::STOPLIGHT,
],
'stoplightio/web-components.min.js',
'stoplight/web-components.min.js',
];

yield 'configure server url' => [
Expand Down
12 changes: 6 additions & 6 deletions tests/DependencyInjection/NelmioApiDocExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public static function provideOpenApiRendererWithHtmlConfig(): \Generator
'assets_mode' => 'cdn',
'swagger_ui_config' => [],
'redocly_config' => [],
'stoplightio_config' => [],
'stoplight_config' => [],
],
];

Expand All @@ -354,7 +354,7 @@ public static function provideOpenApiRendererWithHtmlConfig(): \Generator
'deepLinking' => true,
],
'redocly_config' => [],
'stoplightio_config' => [],
'stoplight_config' => [],
],
];

Expand All @@ -373,21 +373,21 @@ public static function provideOpenApiRendererWithHtmlConfig(): \Generator
'hideDownloadButton' => true,
],
'swagger_ui_config' => [],
'stoplightio_config' => [],
'stoplight_config' => [],
],
];

yield 'stoplightio' => [
yield 'stoplight' => [
[
'assets_mode' => 'bundle',
'stoplightio_config' => [
'stoplight_config' => [
'router' => 'hash',
'hideSchemas' => true,
],
],
[
'assets_mode' => 'bundle',
'stoplightio_config' => [
'stoplight_config' => [
'router' => 'hash',
'hideSchemas' => true,
],
Expand Down
8 changes: 4 additions & 4 deletions utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"swagger:standalone": "cp node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js* $npm_package_config_destinationswagger",
"swagger:css": "cp node_modules/swagger-ui-dist/swagger-ui.css* $npm_package_config_destination_swagger",
"redoc": "cp node_modules/redoc/bundles/redoc.standalone.js $npm_package_config_destination_redoc",
"stoplightio": "yarn run stoplightio:js && yarn run stoplightio:css",
"stoplightio:js": "cp node_modules/@stoplight/elements/web-components.min.js $npm_package_config_destination_stoplightio",
"stoplightio:css": "cp node_modules/@stoplight/elements/styles.min.css $npm_package_config_destination_stoplightio"
"stoplight": "yarn run stoplight:js && yarn run stoplight:css",
"stoplight:js": "cp node_modules/@stoplight/elements/web-components.min.js $npm_package_config_destination_stoplight",
"stoplight:css": "cp node_modules/@stoplight/elements/styles.min.css $npm_package_config_destination_stoplight"
},
"config": {
"destination": {
"swagger": "../public/swagger-ui",
"redoc": "../public/redocly",
"stoplightio": "../public/stoplightio"
"stoplight": "../public/stoplight"
}
}
}

0 comments on commit 4a0b7eb

Please sign in to comment.