xeipuuv/gojsonschema

Load schema from string

Closed this issue · 1 comments

gojsonschema.NewReferenceLoader can load schemas from local files, urls etc. but there is no convenient way to load a schema from a string or a []byte. A good use case would be a schema that has been embedded into the compiled code with the go:embed directive. I think it is possible to create an in-memory filesystem and use that with gojsonschema.NewReferenceLoader but that is very inconvenient.

I'm closing this because gojsonschema.NewStringLoader is already implemented.