MCPcopy Create free account
hub / github.com/apache/trafficserver / validate_schema

Function validate_schema

tools/records/convert2yaml.py:111–123  ·  view source on GitHub ↗
(data, schema_filename)

Source from the content-addressed store, hash-verified

109
110
111def validate_schema(data, schema_filename):
112 if schema_filename:
113 with open(schema_filename, 'r') as f:
114 s = f.read()
115 sdata = json.loads(s)
116 try:
117 # validate will throw if invalid schema.
118 if schema_filename:
119 validate(instance=data, schema=sdata)
120 except ValidationError as ve:
121 return str(ve)
122
123 return ""
124
125
126def save_to_file(filename, is_json, typerepr, no_backup, data):

Callers 1

handle_file_inputFunction · 0.85

Calls 2

strFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected