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

Add Support for Resolving External JSON Schemas #12

Open
tsnyder-gs1us opened this issue Jul 2, 2024 · 2 comments
Open

Add Support for Resolving External JSON Schemas #12

tsnyder-gs1us opened this issue Jul 2, 2024 · 2 comments

Comments

@tsnyder-gs1us
Copy link

We were exploring the visibility of creating a shared GS1 Schema definition instead of copying the same attributes into multiple files. For example, multiple GS1 Credentials have the same organization attributes. Instead of copying these into each JSON Schema we wanted to create a shared GS1 Schema that could be loaded during Schema Validation.

The ajv.js library supports combining JSON Schema before validation using the $ref keyword https://ajv.js.org/guide/combining-schemas.html#combining-schemas-with-ref

One related question. Does the Transmute Library support a way to bypass JSON Schema validation. We have a use case were we like to directly run the JSON Schema validation using the ajv.js library and still use the Transmute library for the Revocation Check.

@OR13
Copy link
Sponsor Member

OR13 commented Jul 2, 2024

Our experience with trace-vocab has lead us to avoid using schemas with $ref.

its possible to support it, but it leads to security / performance issues, and complexity.

I would in general recommend against it, if you have the option to.

@OR13
Copy link
Sponsor Member

OR13 commented Jul 3, 2024

I'll leave this issue open, and see if I can add some tests demonstrating support for this.

The problem is that $ref is usually a relative reference, and the base will be an absolute URL, so even if its supported there could be compatibility issues between collections of schemas hosted via https and collections of schemas hosted in a file system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants