MCPcopy Create free account
hub / github.com/santhosh-tekuri/jsonschema / enqueueRef

Method enqueueRef

objcompiler.go:353–380  ·  view source on GitHub ↗
(pname string)

Source from the content-addressed store, hash-verified

351}
352
353func (c *objCompiler) enqueueRef(pname string) (*Schema, error) {
354 ref := c.strVal(pname)
355 if ref == nil {
356 return nil, nil
357 }
358 baseURL := c.res.id
359 // baseURL := c.r.baseURL(c.up.ptr)
360 uf, err := baseURL.join(*ref)
361 if err != nil {
362 return nil, err
363 }
364
365 up, err := c.r.resolve(*uf)
366 if err != nil {
367 return nil, err
368 }
369 if up != nil {
370 // local ref
371 return c.enqueuePtr(up.ptr), nil
372 }
373
374 // remote ref
375 up_, err := c.c.roots.resolveFragment(*uf)
376 if err != nil {
377 return nil, err
378 }
379 return c.c.enqueue(c.q, up_), nil
380}
381
382func (c *objCompiler) enqueueProp(pname string) *Schema {
383 if _, ok := c.obj[pname]; !ok {

Callers 3

compileDraft4Method · 0.95
compileDraft2019Method · 0.95
compileDraft2020Method · 0.95

Calls 6

strValMethod · 0.95
enqueuePtrMethod · 0.95
joinMethod · 0.80
resolveMethod · 0.80
enqueueMethod · 0.80
resolveFragmentMethod · 0.45

Tested by

no test coverage detected