parseSchema function

SchemaType parseSchema(
  1. String json
)

Parses a JSON string into a SchemaType.

Implementation

SchemaType parseSchema(String json) {
  final map = jsonDecode(json);
  if (map is! Map<String, dynamic>) {
    throw ArgumentError("Invalid schema JSON: $json");
  }
  return SchemaType.fromProperties(map);
}