Expand description
JSON Schema inference from record samples.
Given a slice of JSON values (records from a REST API), produces a JSON Schema that is valid for all of them. The algorithm:
- Each field type is inferred independently per record then merged across records.
- A field absent from some records gets
"null"added to its type. "integer"widens to"number"when the same field is an integer in some records and a float in others.- Nested objects are recursively inferred and merged.
Functionsยง
- infer_
schema - Infer a JSON Schema
objectdescriptor from a slice of record values.