MCPcopy Create free account
hub / github.com/cli/cli / matchesSchema

Function matchesSchema

script/ghmock/restscaffold.go:437–442  ·  view source on GitHub ↗

matchesSchema reports whether a value passes the same check as responses.

(ref *openapi3.SchemaRef, v any)

Source from the content-addressed store, hash-verified

435
436// matchesSchema reports whether a value passes the same check as responses.
437func matchesSchema(ref *openapi3.SchemaRef, v any) bool {
438 if ref == nil || ref.Value == nil {
439 return true
440 }
441 return len(restProblems(ref.Value.VisitJSON(v, openapi3.MultiErrors(), openapi3.VisitAsResponse()))) == 0
442}

Callers 1

fillMethod · 0.85

Calls 1

restProblemsFunction · 0.85

Tested by

no test coverage detected