utils/json_inference library

Classes

ModelDef
A model to generate: a class name and its fields.

Functions

inferModels(String rootName, Object? json) List<ModelDef>
Infers a set of ModelDefs from a decoded JSON value. The root object becomes a model named rootName (PascalCase); nested objects become their own models named after the key that holds them. Returns the root model first followed by nested models (de-duplicated by name).