We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! I'm using json_schema indirectly through https://github.com/thoughtbot/json_matchers so this might not be the right place to report this.
json_schema
I have a question about reference URLs. The following code fails:
# frozen_string_literal: true require "json_schema" store = JsonSchema::DocumentStore.new foo_schema = JsonSchema.parse!( { "id" => "file:/foo.json", "type" => "object", "properties" => { "a" => { "type" => "string" } } } ) store.add_schema(foo_schema) bar_schema = JsonSchema.parse!( { "id" => "file:/bar.json", "type" => "object", "properties" => { "foo" => { "$ref" => "file:/foo.json", } } } ) bar_schema.expand_references!(store: store) bar_schema.validate!( { foo: { a: 1 } } )
However, as a workaround, my team discovered that putting # at the end of foo id and the $ref seems to work.
#
foo
id
$ref
Tracing through the code I found this reference:
json_schema/lib/json_reference.rb
Lines 19 to 20 in 2c0d59b
This seems to indicate that the behavior is intentional. However, I can't figure out what spec is being referred to here. I assumed it was Draft 4, but I didn't see anything about this behavior in https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-04 or the corresponding validation spec (https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00). Am I missing something obvious?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! I'm using
json_schema
indirectly through https://github.com/thoughtbot/json_matchers so this might not be the right place to report this.I have a question about reference URLs. The following code fails:
However, as a workaround, my team discovered that putting
#
at the end offoo
id
and the$ref
seems to work.Tracing through the code I found this reference:
json_schema/lib/json_reference.rb
Lines 19 to 20 in 2c0d59b
This seems to indicate that the behavior is intentional. However, I can't figure out what spec is being referred to here. I assumed it was Draft 4, but I didn't see anything about this behavior in https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-04 or the corresponding validation spec (https://datatracker.ietf.org/doc/html/draft-fge-json-schema-validation-00). Am I missing something obvious?
The text was updated successfully, but these errors were encountered: