-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Always tries to fetch from web #29
Comments
I can share the code I used if it would be helpful, but I can't share the schemas as they are proprietary at present. |
It will only try to fetch the schema if it doesn't exist in the schemaStore. I don't have a lot of information to go on, so it's hard for me to help too much. When you get the error that he URL couldn't be found, it should tell you what the offending URL is, right? I'd start by trying to figure out why a schema with that URL isn't in the schemaStore and try to rectify that problem. If you can provide more information, I'd be happy to try to help more. Sharing code and specific error messages might help, but I suspect there's not much I can figure out without seeing the schemas. If you're able to share over a private channel such as email or the JSON Schema Slack, I'd be happy to look it over. Otherwise I'd suggest trying to create a minimal reproducible example that you can share. |
Is there any way to see what ID caused the fetch to be made? It may be a simple spelling mistake but with ~50 schemas it's going to be hard to track it down. |
Ok so it was a minute spelling mistake on my part. That took some finding! Thanks for your time on this though. It would be great to have some way of knowing where the error was being raised in terms of the schema as well as the calling code. |
Can you share the exact error you were getting or a minimal reproduction of the error? I'd like to see what I can do about improving the experience, but that's hard to do unless I can reproduce that experience. |
Here's a copy of the error caused by a mis-identified schema being referenced in another:
I've seen other errors about invalid schema that have an empty errors array when I use
That one made it hard to track down the errors. I hope these help :) |
This is helpful, thank you!
I get what the problem is now. The error is that the domain is unreachable, but it doesn't include the full URI, which makes it hard to track down the offending schema. I'll probably need to catch this error and return a more helpful one of my own.
You need to configure how you want errors to be presented. The default is the This is something that has confused others as well. I'll see about adding some additional info to the error message to point people in the right direction. |
Thanks for the feedback and info :) |
When I use this example code (modified from the readme):
Then everything works as expected and I get output.
When I try any other code that uses my own schema files, which I have verified are being added to the schemaStore by the right IDs, then I always get an error that the url cannot be found.
Is there something special I need to do to make this work without having an actual domain name that hosts the files? Why would it work with two example schema but not with 50 real ones?
The text was updated successfully, but these errors were encountered: