You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a schema broken into a few components, common.json, input.json, and stored.json; input and stored both reference types from common.
I'm loading all the schemas in my package's init():
var (
SchemaCommon*jsonschema.SchemaSchemaInput*jsonschema.SchemaSchemaStored*jsonschema.Schema
)
funcinit() {
SchemaCommon=jsonschema.Must(schemaCommon)
SchemaInput=jsonschema.Must(schemaInput)
SchemaStored=jsonschema.Must(schemaStored)
}
When I try to validate a document against the input or stored schemas, it gives me a "failed to resolve schema for ref" error.
So, okay, it looks like I have to register the schemas in the schema registry for jsonschema to know about them. That's fine, but the obvious Register() / Get() mechanism doesn't work:
I have a schema broken into a few components,
common.json
,input.json
, andstored.json
; input and stored both reference types from common.I'm loading all the schemas in my package's
init()
:When I try to validate a document against the input or stored schemas, it gives me a "failed to resolve schema for ref" error.
So, okay, it looks like I have to register the schemas in the schema registry for jsonschema to know about them. That's fine, but the obvious
Register()
/Get()
mechanism doesn't work:The ID I'm supplying is the value of the
$id
property at the top level ofcommon.json
.Similarly, if I use
RegisterLocal()
/GetLocal()
, I get anil
schema back as well.How is this supposed to work?
Specific things it would be good to document:
Get()
andGetKnown()
? What makes a schema "known?"Schema.Register()
andSchemaRegistry.Register()
? What cases should each be used in?The text was updated successfully, but these errors were encountered: