Skip to content
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

Have the ability to cache / load local copies of referenced schemas #134

Closed
decentralgabe opened this issue Jul 5, 2022 · 3 comments · Fixed by #269
Closed

Have the ability to cache / load local copies of referenced schemas #134

decentralgabe opened this issue Jul 5, 2022 · 3 comments · Fixed by #269
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@decentralgabe
Copy link
Member

Some schemas, such as those for Credential Manifest rely on additional schemas using the $ref property.

Utilizing these schemas in the sdk resolves in network calls, to resolve the $ref values. It's possible some of these schema URIs may become unavailable. We should have a method to "locally" resolve such schema references. This is possible in ajv.

@decentralgabe
Copy link
Member Author

decentralgabe commented Jul 5, 2022

Should be possible with loaders - https://github.com/xeipuuv/gojsonschema#loaders

@nitro-neal
Copy link
Contributor

First part of this - #221

@nitro-neal
Copy link
Contributor

Added:

// DerefSchemas takes our known schemas and dereferences the schema's $ref http links to be a part of the json schema object.
// This makes our code faster when doing validation checks and allows us to not ping outside sources for schemas refs which may go down or change.
// TODO: (Neal) Currently we do not use these dereferenced schemas in code because there is more work to be done here.
// Currently these dereferenced schemas are missing some information and fail validation with our known json objects
// I believe some more work in the investigation library needs to be done and we need to handle circular dependencies

it could also be our logic to do validation is strange, it seems that these schemas + json objects with an online tool check out..

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants