toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{
    'type': propertyType,
    'description': description,
  };

  if (items != null) {
    json['items'] = items!.toJson();
  }

  if (enumList != null) {
    json['enum'] = enumList;
  }

  if (properties != null) {
    json['properties'] =
        properties!.map((key, value) => MapEntry(key, value.toJson()));
  }

  if (required != null) {
    json['required'] = required;
  }

  return json;
}