diff --git a/CHANGELOG.md b/CHANGELOG.md index f0a858e..5ea37d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.8.0] 2020-11-26 +## [0.9.0] 2021-12-10 +### Added +- Compatibility with PHP 8.1 + +### Changed +- Fix #54 to be able to build a melodiia application on any PAAS service + +## [0.8.0] 2021-11-26 ### Added - Add json-api header in responses diff --git a/docs/config-reference.md b/docs/config-reference.md index 88b71f0..b90e372 100644 --- a/docs/config-reference.md +++ b/docs/config-reference.md @@ -9,6 +9,7 @@ melodiia: # Define as much APIs you want here. main: base_path: /api/v1 + openapi_path: /path/to/your/openapi/doc.yaml pagination: # Using this query attribute you can change the max per page max_per_page_attribute: max_per_page diff --git a/docs/getting-started.md b/docs/getting-started.md index 3489e24..f4de21b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -113,11 +113,23 @@ to configure the OpenAPI documentation in a good way was a serious pain and was But it comes with some help to build your documentation: 1. Run `bin/console assets:insall` 2. Create a file `documentation.yml` (the `config` folder seems like a good location) -2. Add the following routing to your configuration +3. Add your documentation file in the global melodiia configuration and configure your documentation route ```yaml -# The documentation should be available only in dev environment -# routing_dev.yaml +# /config/packages/melodiia.yaml +melodiia: + apis: + main: + # Required all the time! Do not forget this! + base_path: /api/v1 + + # This is what we are looking for here: + openapi_path: /path/to/your/openapi/doc.yaml +``` + +```yaml +# The documentation should be available only in dev environment in some cases +# /config/routing_dev.yaml documentation: path: /documentation controller: 'melodiia.documentation' diff --git a/src/DependencyInjection/MelodiiaExtension.php b/src/DependencyInjection/MelodiiaExtension.php index 2d40cd0..298e385 100644 --- a/src/DependencyInjection/MelodiiaExtension.php +++ b/src/DependencyInjection/MelodiiaExtension.php @@ -50,7 +50,7 @@ public function load(array $configs, ContainerBuilder $container) // This is just a helpful layer in case some dependency is missing, because twig is optional. foreach ($config['api'] as $endpoint) { if (!empty($endpoint[MelodiiaConfiguration::CONFIGURATION_OPENAPI_PATH])) { - throw new DependencyMissingException('You specified a documentation path but twig is not activated. Melodiia will not be able to render your documentation.'); + throw new DependencyMissingException('You specified a documentation path but twig is not installed. Melodiia will not be able to render your documentation.'); } } }