Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix $dynamicAnchor boolean evaluation #8

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning].

## [Unreleased]

### Fixed

- Fix `$dynamicAnchor` boolean evaluation. ([@skryukov])

## [0.2.1] - 2023-12-03

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"

gem "standard", "~> 1.3"
gem "standard", "~> 1.35.0"
2 changes: 1 addition & 1 deletion data/draft-2019-09
Submodule draft-2019-09 updated 1 files
+1 −1 README.md
2 changes: 1 addition & 1 deletion data/draft-2020-12
Submodule draft-2020-12 updated 1 files
+1 −1 README.md
2 changes: 1 addition & 1 deletion lib/json_skooma/json_pointer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def initialize(path)
if path.is_a?(Array)
@path = path
else
super CGI.unescape(path)
super(CGI.unescape(path))
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/json_skooma/keywords/core/dynamic_ref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def resolve
metaschema_uri: parent_schema.metaschema_uri,
cache_id: parent_schema.cache_id
)
dynamic_anchor = @ref_schema["$dynamicAnchor"]
dynamic_anchor = @ref_schema["$dynamicAnchor"] if @ref_schema.type == "object"
@dynamic = dynamic_anchor == @fragment
end

Expand Down
2 changes: 1 addition & 1 deletion lib/json_skooma/validators/time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def valid_leap_seconds?(match)
if match[:on]
sign = (match[:on] == "+") ? -1 : 1
time += sign * (match[:oh].to_i * 60 + match[:om].to_i)
time = time % (60 * 24)
time %= (60 * 24)
end
leap_time = 23 * 60 + 59
time == leap_time
Expand Down
2 changes: 1 addition & 1 deletion spec/json_schema_test_suite
Submodule json_schema_test_suite updated 66 files
+1 −0 README.md
+1 −0 remotes/draft-next/format-assertion-false.json
+1 −0 remotes/draft-next/format-assertion-true.json
+1 −0 remotes/draft-next/metaschema-no-validation.json
+1 −0 remotes/draft-next/metaschema-optional-vocabulary.json
+1 −0 remotes/draft2019-09/metaschema-no-validation.json
+1 −0 remotes/draft2019-09/metaschema-optional-vocabulary.json
+1 −0 remotes/draft2020-12/format-assertion-false.json
+1 −0 remotes/draft2020-12/format-assertion-true.json
+1 −0 remotes/draft2020-12/metaschema-no-validation.json
+1 −0 remotes/draft2020-12/metaschema-optional-vocabulary.json
+0 −114 tests/draft-next/anchor.json
+30 −0 tests/draft-next/dynamicRef.json
+96 −0 tests/draft-next/enum.json
+0 −294 tests/draft-next/id.json
+1 −1 tests/draft-next/maxLength.json
+1 −1 tests/draft-next/minLength.json
+60 −0 tests/draft-next/optional/anchor.json
+53 −0 tests/draft-next/optional/id.json
+0 −0 tests/draft-next/optional/unknownKeyword.json
+31 −0 tests/draft-next/unevaluatedItems.json
+38 −0 tests/draft-next/unevaluatedProperties.json
+0 −115 tests/draft2019-09/anchor.json
+96 −0 tests/draft2019-09/enum.json
+0 −294 tests/draft2019-09/id.json
+1 −1 tests/draft2019-09/maxLength.json
+1 −1 tests/draft2019-09/minLength.json
+151 −3 tests/draft2019-09/not.json
+60 −0 tests/draft2019-09/optional/anchor.json
+53 −0 tests/draft2019-09/optional/id.json
+0 −0 tests/draft2019-09/optional/unknownKeyword.json
+0 −15 tests/draft2019-09/ref.json
+31 −0 tests/draft2019-09/unevaluatedItems.json
+38 −0 tests/draft2019-09/unevaluatedProperties.json
+0 −115 tests/draft2020-12/anchor.json
+30 −0 tests/draft2020-12/dynamicRef.json
+96 −0 tests/draft2020-12/enum.json
+0 −294 tests/draft2020-12/id.json
+1 −1 tests/draft2020-12/maxLength.json
+1 −1 tests/draft2020-12/minLength.json
+151 −3 tests/draft2020-12/not.json
+60 −0 tests/draft2020-12/optional/anchor.json
+53 −0 tests/draft2020-12/optional/id.json
+0 −0 tests/draft2020-12/optional/unknownKeyword.json
+0 −15 tests/draft2020-12/ref.json
+31 −0 tests/draft2020-12/unevaluatedItems.json
+38 −0 tests/draft2020-12/unevaluatedProperties.json
+1 −1 tests/draft3/maxLength.json
+1 −1 tests/draft3/minLength.json
+84 −0 tests/draft4/enum.json
+1 −1 tests/draft4/maxLength.json
+1 −1 tests/draft4/minLength.json
+62 −1 tests/draft4/not.json
+0 −0 tests/draft4/optional/id.json
+84 −0 tests/draft6/enum.json
+1 −1 tests/draft6/maxLength.json
+1 −1 tests/draft6/minLength.json
+147 −5 tests/draft6/not.json
+0 −0 tests/draft6/optional/id.json
+0 −0 tests/draft6/optional/unknownKeyword.json
+84 −0 tests/draft7/enum.json
+1 −1 tests/draft7/maxLength.json
+1 −1 tests/draft7/minLength.json
+147 −5 tests/draft7/not.json
+0 −0 tests/draft7/optional/id.json
+0 −0 tests/draft7/optional/unknownKeyword.json
Loading