Conversation
…ompare ranges (ota42y#209) * Enumerate specs for a comparable openapi_version List the cases for returning openapi_version as a Gem::Version, for the version range helpers on SpecValidator::Rule, and for the 3.1-or-later rules applied to 3.2 documents. * Add version range helpers to SpecValidator::Rule Rules compare the declared version with == against a Symbol today, which cannot express "3.1 or later". version_before? and version_at_least? take a boundary string and compare against a Gem::Version, returning false for an unknown version. * Return openapi_version as a Gem::Version and compare ranges in rules openapi_version returned :v3_0 / :v3_1 / :unknown and every rule compared it with ==, so a 3.2 document fell into :unknown and no rule ran on it. It now returns Gem::Version (prerelease dropped) or nil when the field is missing or not a major.minor[.patch] string. Rules use version_before?('3.1') / version_at_least?('3.1'), so the 3.1-or-later rules (nullable, singular example, Boolean exclusiveMinimum / exclusiveMaximum) also cover 3.2. --------- Co-authored-by: fusagiko / takayamaki <takayamaki@users.noreply.github.com>
modosc
force-pushed
the
openapi-3-2/version-detection
branch
from
September 23, 2026 15:40
808130d to
2793569
Compare
Author
|
Superseded by upstream ota42y#209, which returns |
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.
First PR of the OpenAPI 3.2 stack.
openapi_versionnow returns:v3_2;RulegainsVERSION_ORDER+version_before?/version_at_least?; the existing 3.1 rules (NullableDeprecation, ExampleSingularDeprecation, ExclusiveMinimum/Maximum) now fire on 3.2 documents too.🤖 Generated with Claude Code