{"id":20234231,"url":"https://github.com/temirkhann/openapi-validator-bundle","last_synced_at":"2026-05-06T09:37:59.394Z","repository":{"id":62550971,"uuid":"504143075","full_name":"TemirkhanN/openapi-validator-bundle","owner":"TemirkhanN","description":"An OpenAPI specification validator for a symfony application","archived":false,"fork":false,"pushed_at":"2022-06-17T17:28:10.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T19:57:27.471Z","etag":null,"topics":["openapi","symfony-bundle"],"latest_commit_sha":null,"homepage":"https://temirkhan.nasukhov.me/blog/2022-06-07_How-to-keep-an-API-documentation-up-to-date","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TemirkhanN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-16T12:15:29.000Z","updated_at":"2023-07-18T18:24:09.000Z","dependencies_parsed_at":"2022-11-03T02:15:38.846Z","dependency_job_id":null,"html_url":"https://github.com/TemirkhanN/openapi-validator-bundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TemirkhanN/openapi-validator-bundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemirkhanN%2Fopenapi-validator-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemirkhanN%2Fopenapi-validator-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemirkhanN%2Fopenapi-validator-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemirkhanN%2Fopenapi-validator-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TemirkhanN","download_url":"https://codeload.github.com/TemirkhanN/openapi-validator-bundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TemirkhanN%2Fopenapi-validator-bundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27343693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-29T02:00:06.589Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openapi","symfony-bundle"],"created_at":"2024-11-14T08:09:22.265Z","updated_at":"2025-11-29T09:04:37.026Z","avatar_url":"https://github.com/TemirkhanN.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openapi-validator-bundle\nAn OpenAPI specification validator for a symfony application\n\nIt checks if the request and response from your symfony application matches your openapi documentation file.  \nIf the endpoint is not documented, receives or responds with mismatching payload it will throw `ValidationError`.  \nThis comes in handy when application has integration/functional/manual tests because it will alert early that documentation \nis outdated.  \n\n## Installation\n\n```bash\ncomposer require temirkhann/openapi-validator-bundle\n```\n\n## Usage\n\nEnable bundle in `config/bundles.php`\n\n```php\n\n// Usually you don't want validation to work on your production server.  \n// So, enable it for all envs and disable for prod\nreturn [\n    Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle::class =\u003e ['test' =\u003e true],\n    ....\n    TemirkhanN\\OpenapiValidatorBundle\\OpenapiValidatorBundle::class =\u003e ['all' =\u003e true, 'prod' =\u003e false],\n];\n\n```\n\n\nDeclare configuration in `config/packages/openapi_validator.yaml` as follows:  \n```yaml\nopenapi_validator:\n  # Path to your openapi specification (json or yaml)\n  # Only local file is accepted (http links won't work)\n  specification: '%kernel.project_dir%/openapi.yaml'\n\n```\n\n## Configuration\n\nIf you have multiple sections in your application or for some reason don't want to apply validation to some particular  \nendpoints you can use exclusion policy\n\n```yaml\nopenapi_validator:\n  specification: '%kernel.project_dir%/openapi.yaml'\n  policy:\n    exclude:\n      paths:\n        - '#^/some-internal/#'\n      status_codes:\n        - 304\n        - 500\n```\n\n`paths` accepts list of regexp patterns. If the request path(not URI) matches pattern then validation will be omitted.  \n\u003e defaults value is empty list - validation is applied to every single route.\n\n\n`status_codes` accepts list of integer values which represent http status-codes. If response code matches any of these  \nthen validation will be omitted.  \n\u003e default value is 500. There should never be 500 in API documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemirkhann%2Fopenapi-validator-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemirkhann%2Fopenapi-validator-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemirkhann%2Fopenapi-validator-bundle/lists"}