-
Notifications
You must be signed in to change notification settings - Fork 23
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
Allow alternate means of retrieving content #14
Comments
Hi, I was checking out this library, and did notice it attempts to download content from https://json-schema.org/ -- in my use case, I would need application to work offline.. so probably embed the schema files would work. @jimblackler any advice to avoid the external download attempt? |
They can be cached on the first instance if you ever do have internet
access.
It's not strictly necessary to have the metaschema, it just can't validate
the schemas themselves.
I can't recall currently what happens if the fetch can't complete.
Certainly it could be configured to continue without the schema validation
against the metaschema.
…On Tue, 14 Dec 2021 at 17:15, Pedro Henriques dos Santos Teixeira < ***@***.***> wrote:
Hi, I was checking out this library, and did notice it attempts to
download content from https://json-schema.org/ -- in my use case, I would
need application to work offline.. so probably embed the schema files would
work. Any advice to avoid the external download attempt?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFH6F4CVSWQSTXAD5WU32LUQ53UNANCNFSM5IWSKY4A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
At the moment there's a network exception, so AFAIK the library wouldn't really work in offline mode. |
Depending on how you load the schemas, providing 'null' as the validator jsonschemafriend/library/src/main/java/net/jimblackler/jsonschemafriend/SchemaStore.java Line 72 in e2e3366
|
Hi are there any plans to release this change? In my use case, I would need the application to work offline, is there a way it can pick up the schema from resource folder if specified there? |
Sorry I thought I had made a release since then. I'll do a release when the current outstanding PR is in. |
Hi are there any plans on releasing the latest changes? |
Thank you for the reminder. I just pushed 0.11.3, it should show up on Jitpack shortly. |
At the moment the
SchemaStore
will, if it finds a schema that hasn't yet been resolved, call thegetContent
method to retrieve it:https://github.com/jimblackler/jsonschemafriend/blob/master/library/src/main/java/net/jimblackler/jsonschemafriend/SchemaStore.java#L144
That getContent method will then use the static CacheLoader.load method.
I see you can also preload the SchemaStore using the public store or register methods.
What I'm asking for though is the ability to intercept that getContent loading method (in my case I may want to store schemas in some persistence layer), via say an interface ContentLoader ...
Maybe that would also help with developers who have issues like #3 and need to provide their own means of resolving a schema?
The text was updated successfully, but these errors were encountered: