软件包/mashware/open-api-messaging-context

Behat 测试环境,用于验证 symfony 2 的 OpenApi 架构的消息

v2.1.1 2021-09-14 11:14 UTC

This package is auto-updated.

Last update: 2024-09-14 20:20:18 UTC


README

在 behat 中提供少量上下文,用于根据 AsyncApi 和 OpenApi 规范验证已发布的消息和 HTTP 响应。

安装

composer require --dev mashware/open-api-messaging-context

如何使用

在您的 behat.yml 中配置上下文

default:
  suites:
    default:
      contexts:
        - PcComponentes\OpenApiMessagingContext\Behat\ResponseValidatorOpenApiContext:
          - '%%kernel.project_dir%%'

检查您的 openapi 文件中是否记录了 HTTP 响应

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"