-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add a registry that can be used with JSON Schema validation #549
Comments
I suppose we could add another parameter to Compare that with our resolver example. Here, the resolver looks like json resolver(const jsoncons::uri& uri)
{
std::string pathname = "./input/jsonschema/";
pathname += std::string(uri.path());
std::fstream is(pathname.c_str());
if (!is)
{
return json::null();
}
return json::parse(is);
} To build the schema, the schema builder needs to resolve the URI
Any subsequent need to resolve those URI's is done using the internal registry rather than the resolver. We couldn't do something analogous with a schema registry of uri's and |
@danielaparker Could you clarify how the existing resolver could be used to supply just That is, can I provide the schema for
|
Yes. |
Could you give an example of how that would work? It seems like this would already resolve the issue here. (Although perhaps there could end up being a somewhat nicer API for what I'm trying to achieve.) |
Describe the proposed feature
Many JSON Schema validators support the ability to register external schemas based on their ID so they can be resolved at validation time.
The idea is that you pass in the schema and the ID and it would be saved into a local registry so that any future schemas which reference that schema by ID will discover it without needing resolution.
What other libraries (C++ or other) have this feature?
[Blaze]https://github.com/sourcemeta/blaze) is the only C++ library I am aware of.
Include a code fragment with sample data that illustrates the use of this feature
This is something that should be possible by implementing a resolver which has a method to add a schema instance.
The text was updated successfully, but these errors were encountered: