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

This package is auto-updated.

Last update: 2024-12-14 20:50:46 UTC


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"