A Swagger UI plugin that automatically makes URLs in descriptions and examples clickable.
- Detects URLs in API responses and examples.
- Makes URLs clickable with proper
target="_blank"and security attributes. - Works with both JSON and plain text responses.
- Seamlessly integrates with existing Swagger UI installations.
<script src="https://unpkg.com/swagger-ui-dist@5.10.0/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-clickable-links/"></script>
<script>
SwaggerUIBundle({
dom_id: '#swagger-ui',
url: 'https://petstore.swagger.io/v2/swagger.json',
plugins: [ SwaggerUIClickableLinks ],
});
</script>npm install swagger-ui-clickable-linksimport SwaggerUI from 'swagger-ui';
import SwaggerUIClickableLinks from 'swagger-ui-clickable-links';
SwaggerUI({
dom_id: '#swagger-ui',
url: 'https://petstore.swagger.io/v2/swagger.json',
plugins: [ SwaggerUIClickableLinks ],
});Check the example/ directory for a complete working example.
GPL-3.0 - see LICENSE for details.
Feel free to open issues or submit pull requests for improvements or bug fixes.