{"id":19216467,"url":"https://github.com/tuwilof/esplanade","last_synced_at":"2025-05-12T23:30:13.122Z","repository":{"id":46701833,"uuid":"81071267","full_name":"tuwilof/esplanade","owner":"tuwilof","description":"Validate requests and responses against API Blueprint specifications","archived":false,"fork":false,"pushed_at":"2024-12-06T04:41:06.000Z","size":210,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T19:38:46.741Z","etag":null,"topics":["api-blueprint","drafter","json-schema","validation"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/tuwilof.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-06T09:38:23.000Z","updated_at":"2024-12-06T04:40:46.000Z","dependencies_parsed_at":"2025-04-20T19:36:10.608Z","dependency_job_id":"4c72b1b3-e593-41b2-8cc5-1013a465c841","html_url":"https://github.com/tuwilof/esplanade","commit_stats":null,"previous_names":["matchtechnologies/esplanade"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuwilof%2Fesplanade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuwilof%2Fesplanade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuwilof%2Fesplanade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuwilof%2Fesplanade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuwilof","download_url":"https://codeload.github.com/tuwilof/esplanade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253839951,"owners_count":21972401,"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","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":["api-blueprint","drafter","json-schema","validation"],"created_at":"2024-11-09T14:17:17.396Z","updated_at":"2025-05-12T23:30:13.096Z","avatar_url":"https://github.com/tuwilof.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Esplanade\n\nThis gem helps you to validate and synchronize your API in strict accordance to the documentation in\n[API Blueprint](https://apiblueprint.org/) and [OpenAPI](https://www.openapis.org/) formats.\nTo do this it automatically searches received requests and responses in the documentation and run\nJSON-schemas validators.\n\n## Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Middlewares](#middlewares)\n  - [Esplanade::SafeMiddleware](#esplanadesafemiddleware)\n  - [Esplanade::DangerousMiddleware](#esplanadedangerousmiddleware)\n  - [Esplanade::CheckCustomResponseMiddleware](#esplanadecheckcustomresponsemiddleware)\n- [Esplanade::Error](#esplanadeerror)\n  - [Esplanade::Request::Error](#esplanaderequesterror)\n    - [Esplanade::Request::PrefixNotMatch](#esplanaderequestprefixnotmatch)\n    - [Esplanade::Request::NotDocumented](#esplanaderequestnotdocumented)\n    - [Esplanade::Request::ContentTypeIsNotJson](#esplanaderequestcontenttypeisnotjson)\n    - [Esplanade::Request::BodyIsNotJson](#esplanaderequestbodyisnotjson)\n    - [Esplanade::Request::Invalid](#esplanaderequestinvalid)\n  - [Esplanade::Response::Error](#esplanaderesponseerror)\n    - [Esplanade::Response::NotDocumented](#esplanaderesponsenotdocumented)\n    - [Esplanade::Response::BodyIsNotJson](#esplanaderesponsebodyisnotjson)\n    - [Esplanade::Response::Invalid](#esplanaderesponseinvalid)\n- [Middleware args](#middleware-args)\n  - [`apib_path`](#apib_path)\n  - [`drafter_yaml_path`](#drafter_yaml_path)\n  - [`prefix`](#prefix)\n- [License](#license)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'esplanade'\n```\n\nAfter that execute:\n\n```bash\n$ bundle\n```\n\nOr install the gem by yourself:\n\n```bash\n$ gem install esplanade\n```\n\n## Usage\n\n`config/application.rb`:\n\n```ruby\nconfig.middleware.use Esplanade::SafeMiddleware, drafter_yaml_path: 'doc.yaml'\n```\n\n## Middlewares\n\n### Esplanade::SafeMiddleware\n\nDebug logger.\n\n### Esplanade::DangerousMiddleware\n\nIt throws errors, so you should add your own middleware for processing.\n\n```ruby\nconfig.middleware.use YourMiddleware\nconfig.middleware.use Esplanade::DangerousMiddleware, drafter_yaml_path: 'doc.yaml'\n```\n\n### Esplanade::CheckCustomResponseMiddleware\n\nUse it if you want to be sure that you have documented new custom responses.\n\n```ruby\nconfig.middleware.use Esplanade::CheckCustomResponseMiddleware, drafter_yaml_path: 'doc.yaml'\nconfig.middleware.use YourMiddleware\nconfig.middleware.use Esplanade::DangerousMiddleware, drafter_yaml_path: 'doc.yaml'\n```\n\n## Esplanade::Error\n\nParent class for those described below.\n\n### Esplanade::Request::Error\n\nParent class for those described below. Inherited from `Esplanade::Error`.\n\n#### Esplanade::Request::PrefixNotMatch\n\nError message format:\n\n```ruby\n{\n  :method =\u003e \"method\",\n  :path =\u003e \"path\",\n  :raw_path =\u003e \"path\",\n  :content_type =\u003e \"content_type\"\n}\n```\n\n#### Esplanade::Request::NotDocumented\n\nError message format:\n\n```ruby\n{\n  :method =\u003e \"method\",\n  :path =\u003e \"path\",\n  :raw_path =\u003e \"path\",\n  :content_type =\u003e \"content_type\"\n}\n```\n\n#### Esplanade::Request::ContentTypeIsNotJson\n\nError message format:\n\n```ruby\n{\n  :method =\u003e \"method\",\n  :path =\u003e \"path\",\n  :raw_path =\u003e \"path\",\n  :content_type =\u003e \"content_type\"\n}\n```\n\n#### Esplanade::Request::BodyIsNotJson\n\nThrows an error also when the body is empty and equal nil.\n\nError message format:\n\n```ruby\n{\n  :method =\u003e \"method\",\n  :path =\u003e \"path\",\n  :raw_path =\u003e \"path\",\n  :content_type =\u003e \"content_type\",\n  :body =\u003e \"body\"\n}\n```\n\n#### Esplanade::Request::Invalid\n\nError message format:\n\n```ruby\n{\n  :method =\u003e \"method\",\n  :path =\u003e \"path\",\n  :raw_path =\u003e \"path\",\n  :content_type =\u003e \"content_type\",\n  :body =\u003e \"body\",\n  :error =\u003e [\"error\"]\n}\n```\n\n### Esplanade::Response::Error\n\nParent class for those described below. Inherited from `Esplanade::Error`.\n\n#### Esplanade::Response::NotDocumented\n\nError message format:\n\n```ruby\n{\n  :request =\u003e {\n    :method =\u003e \"method\",\n    :path =\u003e \"path\",\n    :raw_path =\u003e \"path\"\n  },\n  :status =\u003e \"status\"\n}\n```\n\n#### Esplanade::Response::BodyIsNotJson\n\nIt's thrown when expected response to request isn't JSON (not `Content-Type: application/json`) and there's no non-JSON responses documented for the endpoint.\n\nError message format:\n\n```ruby\n{\n  :request =\u003e {\n    :method =\u003e \"method\",\n    :path =\u003e \"path\",\n    :raw_path =\u003e \"path\"\n  },\n  :status =\u003e \"status\",\n  :body =\u003e \"body\"\n}\n```\n\n#### Esplanade::Response::Invalid\n\nError message format:\n\n```ruby\n{\n  :request =\u003e {\n    :method =\u003e \"method\",\n    :path =\u003e \"path\",\n    :raw_path =\u003e \"path\"\n  },\n  :status =\u003e \"status\",\n  :body =\u003e \"body\",\n  :error =\u003e [\"error\"]\n}\n```\n\n## Middleware args\n\nSupport any [tomograph constructor-params](https://github.com/tuwilof/tomograph/tree/master#constructor-params)\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n[Sponsored by FunBox](https://funbox.ru)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuwilof%2Fesplanade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuwilof%2Fesplanade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuwilof%2Fesplanade/lists"}