mashware / open-api-messaging-context
Behat context for validating messages with OpenApi schema for symfony 2
v2.1.1
2021-09-14 11:14 UTC
Requires
- php: ^7.4
- ext-json: *
- behat/mink: ^1.8
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.3
- behat/symfony2-extension: ^2.1
Requires (Dev)
- pccomponentes/coding-standard: ^1.0
- phpunit/phpunit: ^9.0
- symfony/var-dumper: ^2.8
README
Little context in behat for validate published messages and http responses according to an AsyncApi and OpenApi specification.
Installation
composer require --dev mashware/open-api-messaging-context
How to use
Configure the context in your behat.yml
default: suites: default: contexts: - PcComponentes\OpenApiMessagingContext\Behat\ResponseValidatorOpenApiContext: - '%%kernel.project_dir%%'
Check if http responses are documented in your openapi file:
Then the response should be valid according to OpenApi "docs/openapi.yml" with path "/your/openapi/path/" And the JSON response should be valid according to OpenApi "docs/openapi.yml" schema "MySchema"