ArrayProperty.fromJson constructor

ArrayProperty.fromJson(
  1. Map<String, dynamic> json
)

Creates an ArrayProperty from a JSON Schema fragment.

Implementation

factory ArrayProperty.fromJson(Map<String, dynamic> json) {
  return ArrayProperty(
    items: json['items'] == null
        ? null
        : TProperty.fromJson(json['items'] as Map<String, dynamic>),
    format: json['format'] as String?,
    defaultValue: json['default'],
    nullable: json['nullable'] ?? false,
    enumValues: (json['enum'] as List<dynamic>? ?? [])
        .map((e) => e.toString())
        .toList(),
  );
}