Introduce ScalarUI
Description
I really like this new interactive API documentation call ScalarUI and would be great to add it
Example
At the moment I implemented using Twig Replacement
Would you be able to document this? Thanks!
What should i do document? i can describe what i did to make that possible:
- Create a twig file under
/templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig - Copy the html below:
{# templates/bundles/ApiPlatformBundle/SwaggerUi/index.html.twig #}
{% set openApiJson = swagger_data["spec"] %}
<!doctype html>
<html>
<head>
<title>Scalar API Reference</title>
<meta charset="utf-8"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1"/>
</head>
<body>
<script
id="api-reference"
type="application/json">{{ openApiJson| json_encode | raw }}</script>
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
</body>
</html>
- Under
api_platform.yaml, define the following properties:tittle,descriptionandversion.
I tested using a Jwt token in a custom header as authentication
this is awesome you could probably add it to https://github.com/api-platform/docs/blob/3.3/core/openapi.md ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.