JsonSchema.fromJson constructor

JsonSchema.fromJson(
  1. Map json_
)

Implementation

JsonSchema.fromJson(core.Map json_)
    : this(
        default_: json_.containsKey('default') ? json_['default'] : null,
        description: json_.containsKey('description')
            ? json_['description'] as core.String
            : null,
        enum_: json_.containsKey('enum') ? json_['enum'] as core.List : null,
        format: json_.containsKey('format')
            ? json_['format'] as core.String
            : null,
        items: json_.containsKey('items')
            ? JsonSchema.fromJson(
                json_['items'] as core.Map<core.String, core.dynamic>)
            : null,
        jdbcType: json_.containsKey('jdbcType')
            ? json_['jdbcType'] as core.String
            : null,
        properties: json_.containsKey('properties')
            ? (json_['properties'] as core.Map<core.String, core.dynamic>)
                .map(
                (key, value) => core.MapEntry(
                  key,
                  JsonSchema.fromJson(
                      value as core.Map<core.String, core.dynamic>),
                ),
              )
            : null,
        required: json_.containsKey('required')
            ? (json_['required'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        type: json_.containsKey('type')
            ? (json_['type'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
      );