MCPcopy Create free account
hub / github.com/dropbox/dbxcli / decodeJSONErrorResponse

Function decodeJSONErrorResponse

cmd/output_test.go:1257–1270  ·  view source on GitHub ↗
(t *testing.T, value string)

Source from the content-addressed store, hash-verified

1255}
1256
1257func decodeJSONErrorResponse(t *testing.T, value string) jsonErrorResponse {
1258 t.Helper()
1259
1260 schema := compileJSONSchemaFile(t, "../docs/json-schema/v1/error.schema.json")
1261 if err := schema.Validate(decodeJSONValueForSchema(t, []byte(value))); err != nil {
1262 t.Fatalf("JSON error response does not validate: %v\noutput: %s", err, value)
1263 }
1264
1265 var got jsonErrorResponse
1266 if err := json.Unmarshal([]byte(value), &got); err != nil {
1267 t.Fatalf("decode JSON error response: %v\noutput: %s", err, value)
1268 }
1269 return got
1270}

Calls 2

compileJSONSchemaFileFunction · 0.85
decodeJSONValueForSchemaFunction · 0.85

Tested by

no test coverage detected