You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delete the OpenAPI schema file and then run rspec-openapi for all tests to build it from scratch.
Just run rspec-openapi and update auto-generated fields while leaving all past changes.
By default, it works in mode 2 because it allows you to incrementally update the schema and also leave manual changes for fields that rspec-openapi cannot automatically generate.
Problem
However, the default behavior, mode 2, sometimes has a problem. As described in #47, when you delete a parameter, even if you remove the parameter and rerun the same spec, it will not delete such obsoleted fields for you.
Proposed Solution
We could possibly build each endpoint from scratch, but leaving keys that rspec-openapi does NOT support. When you run a single spec that requests a route, everything under the path/method should be erased while leaving keys that rspec-openapi cannot update as is, and then changes generated by rspec-openapi should be added to it.
It does mean that you will need to run multiple specs for the same endpoint when some tests are testing only some subset of parameters and you need to run all of them to document everything, but generally, running a single spec file or a describe block should be enough and it's probably not too hard.
The text was updated successfully, but these errors were encountered:
https://github.com/k0kubun/rspec-openapi/blob/v0.4.8/lib/rspec/openapi/schema_merger.rb#L28
Background
Currently, we have two ways to use rspec-openapi:
By default, it works in mode 2 because it allows you to incrementally update the schema and also leave manual changes for fields that rspec-openapi cannot automatically generate.
Problem
However, the default behavior, mode 2, sometimes has a problem. As described in #47, when you delete a parameter, even if you remove the parameter and rerun the same spec, it will not delete such obsoleted fields for you.
Proposed Solution
We could possibly build each endpoint from scratch, but leaving keys that rspec-openapi does NOT support. When you run a single spec that requests a route, everything under the path/method should be erased while leaving keys that rspec-openapi cannot update as is, and then changes generated by rspec-openapi should be added to it.
It does mean that you will need to run multiple specs for the same endpoint when some tests are testing only some subset of parameters and you need to run all of them to document everything, but generally, running a single spec file or a describe block should be enough and it's probably not too hard.
The text was updated successfully, but these errors were encountered: