47 lines
1.5 KiB
Twig
47 lines
1.5 KiB
Twig
{# This file is part of the API Platform project.
|
|
|
|
(c) Kévin Dunglas <dunglas@gmail.com>
|
|
|
|
For the full copyright and license information, please view the LICENSE
|
|
file that was distributed with this source code. #}
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
{% block meta %}
|
|
<meta charset="UTF-8">
|
|
{% endblock meta %}
|
|
<title>{% block title %}{{ swagger_data.spec.info.title }}{% endblock title %}</title>
|
|
|
|
{% block stylesheets %}
|
|
{{ nelmioAsset(assets_mode, 'swagger-ui/swagger-ui.css') }}
|
|
{{ nelmioAsset(assets_mode, 'style.css') }}
|
|
{% endblock stylesheets %}
|
|
|
|
{% block swagger_data %}
|
|
{# json_encode(65) is for JSON_UNESCAPED_SLASHES|JSON_HEX_TAG to avoid JS XSS #}
|
|
<script id="swagger-data" type="application/json">{{ swagger_data|json_encode(65)|raw }}</script>
|
|
{% endblock swagger_data %}
|
|
</head>
|
|
<body>
|
|
{% block swagger_ui %}
|
|
<div id="swagger-ui" class="api-platform"></div>
|
|
{% endblock %}
|
|
|
|
{% block javascripts %}
|
|
{{ nelmioAsset(assets_mode, 'swagger-ui/swagger-ui-bundle.js') }}
|
|
{{ nelmioAsset(assets_mode, 'swagger-ui/swagger-ui-standalone-preset.js') }}
|
|
{% endblock javascripts %}
|
|
|
|
{{ nelmioAsset(assets_mode, 'init-swagger-ui.js') }}
|
|
|
|
{% block swagger_initialization %}
|
|
<script type="text/javascript">
|
|
window.onload = () => {
|
|
loadSwaggerUI({{ swagger_ui_config|json_encode(65)|raw }});
|
|
};
|
|
</script>
|
|
{% endblock swagger_initialization %}
|
|
</body>
|
|
</html>
|