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

Local file schemas references #79

Open
krystof-k opened this issue Jul 8, 2024 · 2 comments
Open

Local file schemas references #79

krystof-k opened this issue Jul 8, 2024 · 2 comments

Comments

@krystof-k
Copy link

It'd be great if using local file schemas references like "$ref": "./some-other.schema.json" is supported. It should be possible using JSONSchemer ref_resolver feature.

@remi
Copy link
Member

remi commented Jul 15, 2024

Hi @krystof-k,

Would you be willing to put together a proof-of-concept to see how it would work?

Thank you!

@krystof-k
Copy link
Author

I just found it it may be already possible using the options with ref_resolver to pass the referenced schemas (haven't tried that yet).

However, I was initially thinking like you would be able to just pass a directory and the gem would load the referenced schemas without having to list them manually. Allowing something like this:

validates :profile, presence: true, json: { schema: "./path/to/schema.json", directory: "./path/to/schemas" }

Maybe it would make even more sense to be able to do this directly in JSONSchemer.

Unfortunately I don't currently have a time budget to look more into this, I just copy-pasted the common parts of the schemas for now.

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