Repository navigation
Conversation
Danger ReportNo issues found. |
numbata
force-pushed
the
pr/7-validation-and-parity
branch
from
October 14, 2026 18:28
5a606c6 to
ef0e11a
Compare
numbata
force-pushed
the
pr/7-validation-and-parity
branch
from
October 14, 2026 19:31
ef0e11a to
84d4ec3
Compare
numbata
force-pushed
the
pr/7-validation-and-parity
branch
from
October 14, 2026 19:41
84d4ec3 to
b99e9dd
Compare
…hemas The OpenAPI 3 output is only useful if standards-conforming tools accept it, and hand-written assertions cannot prove that. This adds a `be_valid_openapi` matcher backed by the OpenAPI 3.0 and 3.1 meta-schemas bundled in the json_schemer development dependency, and checks documents produced from a broad range of APIs against them. It also pins the relationship between the two generators: shared route decisions, and option handling such as `add_root`, `array_use_braces` and `token_owner`, must give the same answer in Swagger 2.0 and OpenAPI 3.x output.
numbata
force-pushed
the
pr/7-validation-and-parity
branch
from
October 14, 2026 20:13
b99e9dd to
acca5c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generated OpenAPI 3 documents are now checked against the official 3.0 and 3.1 meta-schemas, and the 3.x output is compared to Swagger 2.0 output for the decisions both share. This gives maintainers evidence that the new output is valid and consistent before it is released. It adds tests and one development dependency, nothing at runtime.
Problem solved
Hand-written expectations can agree with a wrong document. Only the standard's own schemas can say whether the output is valid, and nothing otherwise stops the two generators from disagreeing on shared behavior.
What changes
A
be_valid_openapimatcher validates documents withJSONSchemer.openapi, using the OpenAPI 3.0 and 3.1 meta-schemas bundled in the json_schemer development dependency, and specs validate documents from a wide range of APIs. Parity specs pin hidden routes, content types,add_root,array_use_braces(flat query and form arrays keep their braces, validated against the meta-schemas) andtoken_ownerto the same answer in both formats (parameter-level hidden procs give the same, wrong, answer in both versions and those examples are pending); the way tags are derived and merged is shared too, except for one documented difference.Drawbacks and nuances
json_schemer; the meta-schemas come from the installed gem version, so a gem upgrade can change what counts as valid.$ref, a duplicateoperationId, or a path parameter missing from the path template, nor whether the description matches the API's real behavior.Alternatives considered
Stacks on: pr/6-oas31-extras.