Open ryanobjc opened 4 months ago
Thanks for the PR!
I've been trying to think about this and how I'd like it to fit with the API in general. Do you mind sharing how you use it? Are you only adding a single schema or would it be more useful if you could add many files?
My code works something like this:
(defun load-all-schemas (&optional (path-pattern "~/json-schemas/**/*.json"))
(json-schema.reference:with-context (*context*)
(loop for p in (directory path-pattern)
do (json-schema.reference:store-reference (json-schema.parse:parse p)))))
something like that.
In my case, the schemas I'm working with aren't formally published so it's impossible to retrieve them from the URIs provided. I have about 30 files here.
Schema sets are sometimes entirely on disk, and we don't want to visit the network, or perhaps the URI doesn't even load. This function will allow the program to parse and store schemas.