Open Api Generator and Validator

v0.2.0 2022-01-20 14:37 UTC

This package is auto-updated.

Last update: 2022-05-20 15:28:13 UTC


Symfony Bundle for validating Request and Response based on open api specification 3.


  • Symfony >= 5
  • PHP >= 7.4
  • PHP Extension JSON


  • nelmio/api-doc-bundle >= 4.0 (Currently in Beta)
    • Why 4.0, version 3 and below only supports version 2 of OpenAPI Specification.


composer require cydrickn/openapi-validator-bundle

Setting Up

Add the bundle in your config/bundles.php


return [
    // ...
    Cydrickn\OpenApiValidatorBundle\CydricknOpenApiValidatorBundle::class => ['all' => true],

Add configuration config/packages/cydrickn_openapi_validator.yml

    validate_request: true
    validate_response: true
      factory: yaml-file
      file: %kernel.project_dir%/config/openapi/spec.yaml


Config Type Required Accepted Value Default Description
validate_request Boolean Yes true or false true Enable validating of request
validate_response Boolean Yes true or false true Enable validating of response
schema.factory String Yes yaml-file, json-file or nelmio yaml-file Factory to use to generate the schema for validation
schema.file String Required only for yaml-file and json-file File path of the specification


  • Add Nelmio Api Schema Factory
  • Add Dynamic Configuration
  • Add document
  • Add Route Schema Factory
  • Add PHP file Schema Factory
  • Code coverage of 100%
  • Add CI
  • Support Lower PHP Version >= 7.1
  • Support Lower Symfony Version >= 3