schema2dart 1.0.4
schema2dart: ^1.0.4 copied to clipboard
Generate strongly typed Dart models from JSON Schema documents.
1.0.4 #
- Preserve shared fields and payloads across nested
anyOfandoneOfobject unions, including overlapping source fields during round trips. - Keep named union types through nullable references and annotated
allOfwrappers, and decode union-based defaults through their public factories.
1.0.3 #
- Fix nested object unions with common sibling properties: generated variants
now preserve shared fields and their
anyOf/oneOfpayload fields during deserialization andtoJson()serialization.
1.0.2 #
- Fix
defaultvalues on array properties whose item type is an enum or union (e.g. aList<InputModality>withdefault: ["text", "image"]): elements now convert through the item type (.fromJson(...)) instead of being emitted as raw untyped literals, which produced invalid Dart. Arrays containing only const-able literals still emitconst [...].
1.0.1 #
- Fix call sites for refs to unions with primitive variants (e.g.
string | intlike a JSON-RPCRequestId):ObjectTypeRef.deserializeInlineno longer casts the wire value to aMap, which threw at runtime for primitive values. The raw value is now passed to the union'sfromJson(dynamic). - Fix property keys containing
$(e.g.$schema): generated string literals now escape the dollar instead of emitting Dart interpolation that referenced the local variable being declared. - Both fixes are applied everywhere property keys are emitted: property access,
remaining.remove(...),keys.contains(...)heuristics, const-value matching, and validation-helper paths.
1.0.0 #
- Initial release.