-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Usage of $ref causes error under certain circumstances #190
Comments
The registered schemas all get an empty fragment because we use
If we assigned |
@pd so, you suggest that we never register schemas with a hash rather than keep that and looking them up with adding one if it is missing? |
I'd have thought that, because $ref's for a schema always end in '#' it would be simpler to store them with that. Also, surely that way is optimised for the common case? (lookup is faster, at the expense of an extra operation during storage) |
TBH, I was not sure about which way to go (and speculated you'll interfere if I pick the wrong choice), with or without # and wondered about which would be faster (which is the only criterion here I think). Is it really required that $ref's end with #? To increase performance, it would be necessary to reliably determine when a normalization is required and when not, so that we can skip calling addressable if an URI already is normalized. But I have no idea how to do that. |
@hoxworth might be a good person to ask about this. Or I could poke to common test suite guys, who are usually good at pointing out the correct way to interpret the spec |
Sure, if they can give us any useful hints we appreciate that. |
I decided to post it on the json-schema google group first (rather than raising an issue on the common test suite just to ask a question) https://groups.google.com/forum/#!topic/json-schema/9KdnjylLp8k |
I'm having this problem; can someone confirm whether or not this bug was supposed to have been fixed in 2.5.0 or if the fix is yet to be released? |
Local referencing seems to be an issue with the json-schema gem. There are a number of issues open: voxpupuli/json-schema#190 voxpupuli/json-schema#370 voxpupuli/json-schema#411 To get around this we are preloading all the schemas into the JSON::Validator at startup using the _name property as the identifier for each schema. This should allow the JSON::Validator the ability to more easily find the necessary referenced schemas.
Local referencing seems to be an issue with the json-schema gem. There are a number of issues open: voxpupuli/json-schema#190 voxpupuli/json-schema#370 voxpupuli/json-schema#411 To get around this we are preloading all the schemas into the JSON::Validator at startup using the _name property as the identifier for each schema. This should allow the JSON::Validator the ability to more easily find the necessary referenced schemas.
While finishing #188 I found out that there is an issue with
$ref
under certain circumstances.If you checkout the branch
any_ref_issue
from my fork and run the tests you'll seeI tracked it down to this spot where the schema is registered with full file URI but the determined schema key is just a path (which should be absolutized as in normalized URI).
I feel like
normalized_uri
should be used here too. Has anyone a quick idea of how to do that?P.S.: And why has the registered schema's key a
#
at the end?The text was updated successfully, but these errors were encountered: