Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pccomponentes/documentation-bundle
The documentation bundle manages the required routes and templates in order to show documentation both in OpenApi and AsyncApi formats.
https://github.com/pccomponentes/documentation-bundle
asyncapi openapi symfony-bundle
Last synced: 24 days ago
JSON representation
The documentation bundle manages the required routes and templates in order to show documentation both in OpenApi and AsyncApi formats.
- Host: GitHub
- URL: https://github.com/pccomponentes/documentation-bundle
- Owner: PcComponentes
- License: mit
- Created: 2022-04-26T18:41:27.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-20T11:15:33.000Z (about 1 year ago)
- Last Synced: 2024-12-15T02:30:42.326Z (about 1 month ago)
- Topics: asyncapi, openapi, symfony-bundle
- Language: PHP
- Homepage: https://www.pccomponentes.com/
- Size: 35.2 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Documentation Bundle
====================The documentation bundle manages the required routes and templates in order to show
documentation both in OpenApi and AsyncApi formats.Installation
------------Add the pccomponentes/documentation-bundle package to your require section in the composer.json file.
```bash
$ composer require pccomponentes/documentation-bundle
```Add the DocumentationBundle to your application's kernel.
```php
['all' => true],
// ...
];
```Usage
-----Configure the paths to your YAML files in your config.yml (Both keys are optional).
```yaml
documentation:
openapi: 'docs/openapi.yml'
asyncapi: 'docs/asyncapi.yml'
```Enable the paths in your routing.yml file.
```yaml
documentation:
resource: '@DocumentationBundle/Resources/config/routing.yaml'
prefix: /docs
```You can choose a prefix where the documentation will be published.
After this, you should be able to see the Swagger interface at `/openapi` (or `/docs/openapi` if you used the `docs`
prefix), the AsyncApi at `/asyncapi`, and all of your event converters at `/converters`.Also, you can customize the [SwaggerUI options](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)
using the key `swagger_options`, and the [AsyncApi ones](https://github.com/asyncapi/asyncapi-react#web-component)
using `asyncapi_options`, for example:```yaml
documentation:
openapi: 'docs/openapi.yml'
asyncapi: 'docs/asyncapi.yml'
swagger_options:
deepLinking: true
displayOperationId: true
displayRequestDuration: true
asyncapi_options:
schemaFetchOptions: '{"method":"GET","mode":"cors"}'
```In addition, you can add your custom links to the homepage using the `links` key, here is an example:
```yaml
documentation:
links:
- title: 'Google'
description: 'You can add some notes for each link'
url: 'https://www.google.com/'
- title: 'Contact PcComponentes'
url: 'https://www.pccomponentes.com/soporte/contactar-con-pccomponentes'
```