{"repo":"exoego/rspec-openapi","free":true,"listed":false,"github":"https://github.com/exoego/rspec-openapi","clone":"git clone https://github.com/exoego/rspec-openapi.git","description":"Generate OpenAPI schema from RSpec request specs","language":"Ruby","stars":508,"topics":["ruby","rspec","openapi","rails"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"rspec-openapi Generate OpenAPI schema from RSpec request specs. What's this? There are some gems which generate OpenAPI specs from RSpec request specs. However, they require a special DSL specific to these gems, and we can't reuse existing request specs as they are. Unlike such existing gems, rspec-openapi can generate OpenAPI specs from request specs without requiring any special DSL. Furthermore, rspec-openapi keeps manual modifications when it merges automated changes to OpenAPI specs in case we can't generate everything from request specs. Installation Add this line to your application's Gemfile: Usage Run rspec with OPENAPI=1 to generate doc/openapi.yaml for your request specs. Example Let's say you have a request spec like this: If you run the spec with OPENAPI=1 , It will generate doc/openapi.yaml file like: and the schema file can be used as an input of Swagger UI or Redoc. Configuration The following configurations are optional. OpenAPI version The generated openapi version defaults to 3.2.0 (the latest). OpenAPI 3.1+ is aligned with JSON Schema 2020-12, so nullable values are expressed via the type array instead of the nullable keyword. - Set RSpec::OpenAPI.openapi version to a 3.0.x string to keep the previous nullable: true output. - A 3.1.x string produces the same schema shapes as the default 3.2.0 ; they differ only in the reported version and the 3.2-only constructs described below ( query / additionalOperations / itemSchema ). Upgrade note: an existing file i","default_branch":null,"files":null,"tree":[],"storefront":"/r/exoego","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/exoego/rspec-openapi/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}