MCPcopy Create free account
hub / github.com/cloudwan/gohan / LoadResourceFromJSONString

Method LoadResourceFromJSONString

schema/manager.go:279–286  ·  view source on GitHub ↗

LoadResourceFromJSONString makes resource from jsonString

(schemaID string, jsonData string)

Source from the content-addressed store, hash-verified

277
278//LoadResourceFromJSONString makes resource from jsonString
279func (manager *Manager) LoadResourceFromJSONString(schemaID string, jsonData string) (*Resource, error) {
280 var data map[string]interface{}
281 err := json.Unmarshal([]byte(jsonData), &data)
282 if err != nil {
283 return nil, err
284 }
285 return manager.LoadResource(schemaID, data)
286}
287
288//ValidateSchema validates json schema
289func (manager *Manager) ValidateSchema(schemaPath, filePath string) error {

Callers

nothing calls this directly

Calls 1

LoadResourceMethod · 0.95

Tested by

no test coverage detected