-
Notifications
You must be signed in to change notification settings - Fork 7
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
$ref that passes lint but fails in validate as error: Could not resolve schema reference
#185
Comments
Hey @robbat2 , thanks for reporting. Let me take a proper look |
@robbat2 OK, I think you are hitting this: https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01#section-8.2.1-3
So in JSON Schema, having a top-level In the mean-time though, I still suggest, as a best practice, setting the top-level URI to an absolute one. It can be a That said, let's keep this issue open, and I'll close it once we fully support relative base URIs :)
That is great feedback! Though keep in mind
? |
See: #185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
I'm also just realising we don't document |
See: #185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #960 See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #960 See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #960 See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #960 See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #960 See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #960 See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
See: sourcemeta/jsonschema#185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Fixes: #185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
OK, I have a PR that fixes the relative base URI undefined behaviour issue and works fine with your schema! #188. I'll release a new version of the JSON Schema CLI with it in a bit. |
Fixes: #185 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Done! Take a look at v4.1.6. It should work fine now: https://github.com/sourcemeta/jsonschema/releases/tag/v4.1.6. Thanks a lot for reporting this! 🙏🏻 |
@jviotti thank you - I confirm it works. Also, as a long-time open source author & maintainer, this was also one of the best interactions I've seen in my life ❤️ |
Always happy to help and thank a lot for the kind words. Truly made my day! 😍 If you feel inclined to rephrase this message as a testimonial in the README (https://github.com/sourcemeta/jsonschema?tab=readme-ov-file#what-our-users-are-saying) I would be forever grateful! And of course, happy to help on anything JSON Schema related any time! |
I'm trying to look at alternate options for validation against JSON Schema for https://github.com/backstage/backstage - and I think I found a case where the schema is valid, but
jsonschema
fails to handle the$ref
behavior correctly.AJV does handle this case correctly. P.S. Globbing for the
-r
argument or accepting a list of files as another file would help in making the commandline much shorter.Shorter part of the error:
This is here in the schema
If I remove
target
from the schema, as it is deprecated, I get a similar error for#statusItem
:Against a checkout of Backstage:
The text was updated successfully, but these errors were encountered: