An open API service indexing awesome lists of open source software.

https://github.com/sillyash/swagger-ui-clickable-links-plugin

A Swagger UI plugin that automatically makes URLs in descriptions and examples clickable.
https://github.com/sillyash/swagger-ui-clickable-links-plugin

openapi openapi3 plugin rest-api swagger-ui

Last synced: 9 months ago
JSON representation

A Swagger UI plugin that automatically makes URLs in descriptions and examples clickable.

Awesome Lists containing this project

README

          

# swagger-ui-clickable-links

A Swagger UI plugin that automatically makes URLs in descriptions and examples clickable.

## Features

- 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.

## Usage

### With CDN

```html

SwaggerUIBundle({
dom_id: '#swagger-ui',
url: 'https://petstore.swagger.io/v2/swagger.json',
plugins: [ SwaggerUIClickableLinks ],
});

```

### With npm

```bash
npm install swagger-ui-clickable-links
```

```javascript
import 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 ],
});
```

## Example

Check the `example/` directory for a complete working example.

---

## License

GPL-3.0 - see [LICENSE](LICENSE) for details.

## Contributing

Feel free to open issues or submit pull requests for improvements or bug fixes.