ensi/openapi-psr7-validator

Validate PSR-7 messages against OpenAPI (3.0.2) specifications expressed in YAML or JSON

0.0.2 2023-03-16 11:49 UTC

This package is auto-updated.

Last update: 2024-04-16 14:18:31 UTC


README

Forked from thephpleague/openapi-psr7-validator

Installation

composer require ensi/openapi-psr7-validator

Additional

Добавлена проверка BodySchemaValidator на отсутствие неописанных ключей в ответе.

Для того, чтобы пропустить данную проверку, в схеме необходимо добавить ключ:

x-skip-response-validation: true

Пример:

Error:
  type: object
  properties:
    code:
      description: Строковый код ошибки
      type: string
    message:
      description: Описание ошибки
      type: string
    meta:
      x-skip-response-validation: true
      type: object
      description: Объект с мета-информацией
  required:
    - code
    - message

Все возможные рекурсии в схемах также должны сопровождаться ключем x-skip-response-validation.