From fba0e3d9911e3deaed79f032fb5231c1c7fe118d Mon Sep 17 00:00:00 2001 From: "art.dambrine" Date: Wed, 31 Mar 2021 12:10:29 +0200 Subject: [PATCH] overwrite api platform swagger ui nav bar --- .../SwaggerUi/index.html.twig | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig b/templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig index e69de29..4ff80a8 100644 --- a/templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig +++ b/templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig @@ -0,0 +1,120 @@ +{# templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig #} + + + + + {% if title %}{{ title }} - {% endif %}API Platform + + {% block stylesheet %} + + + + + + {% endblock %} + + {% set oauth_data = {'oauth': swagger_data.oauth|merge({'redirectUrl' : absolute_url(asset('bundles/apiplatform/swagger-ui/oauth2-redirect.html', assetPackage)) })} %} + {# json_encode(65) is for JSON_UNESCAPED_SLASHES|JSON_HEX_TAG to avoid JS XSS #} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{#
+ +
#} + + + +{% if showWebby %} +
+
+{% endif %} + +
+ +
+
+
+ Available formats: + {% for format in formats|keys %} + {{ format }} + {% endfor %} +
+ Other API docs: + {% set active_ui = app.request.get('ui', 'swagger_ui') %} + {% if swaggerUiEnabled and active_ui != 'swagger_ui' %}Swagger UI{% endif %} + {% if reDocEnabled and active_ui != 're_doc' %}ReDoc{% endif %} + {# FIXME: Typo in graphql => graphQl in SwaggerUiAction #} + {% if not graphqlEnabled %}GraphiQL{% endif %} + {% if graphiQlEnabled %}GraphiQL{% endif %} + {% if graphQlPlaygroundEnabled %}GraphQL Playground{% endif %} +
+
+
+ +{% block javascript %} +{% if (reDocEnabled and not swaggerUiEnabled) or (reDocEnabled and 're_doc' == active_ui) %} + + +{% else %} + + + +{% endif %} +{% endblock %} + + +