JsonSchema.fromJson constructor

JsonSchema.fromJson(
  1. Map json_
)

Implementation

JsonSchema.fromJson(core.Map json_)
    : this(
        P_ref:
            json_.containsKey('\$ref') ? json_['\$ref'] as core.String : null,
        additionalProperties: json_.containsKey('additionalProperties')
            ? JsonSchema.fromJson(json_['additionalProperties']
                as core.Map<core.String, core.dynamic>)
            : null,
        annotations: json_.containsKey('annotations')
            ? JsonSchemaAnnotations.fromJson(
                json_['annotations'] as core.Map<core.String, core.dynamic>)
            : null,
        default_: json_.containsKey('default')
            ? json_['default'] as core.String
            : null,
        deprecated: json_.containsKey('deprecated')
            ? json_['deprecated'] as core.bool
            : null,
        description: json_.containsKey('description')
            ? json_['description'] as core.String
            : null,
        enum_: json_.containsKey('enum')
            ? (json_['enum'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        enumDeprecated: json_.containsKey('enumDeprecated')
            ? (json_['enumDeprecated'] as core.List)
                .map((value) => value as core.bool)
                .toList()
            : null,
        enumDescriptions: json_.containsKey('enumDescriptions')
            ? (json_['enumDescriptions'] as core.List)
                .map((value) => value as core.String)
                .toList()
            : null,
        format: json_.containsKey('format')
            ? json_['format'] as core.String
            : null,
        id: json_.containsKey('id') ? json_['id'] as core.String : null,
        items: json_.containsKey('items')
            ? JsonSchema.fromJson(
                json_['items'] as core.Map<core.String, core.dynamic>)
            : null,
        location: json_.containsKey('location')
            ? json_['location'] as core.String
            : null,
        maximum: json_.containsKey('maximum')
            ? json_['maximum'] as core.String
            : null,
        minimum: json_.containsKey('minimum')
            ? json_['minimum'] as core.String
            : null,
        pattern: json_.containsKey('pattern')
            ? json_['pattern'] 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,
        readOnly: json_.containsKey('readOnly')
            ? json_['readOnly'] as core.bool
            : null,
        repeated: json_.containsKey('repeated')
            ? json_['repeated'] as core.bool
            : null,
        required: json_.containsKey('required')
            ? json_['required'] as core.bool
            : null,
        type: json_.containsKey('type') ? json_['type'] as core.String : null,
        variant: json_.containsKey('variant')
            ? JsonSchemaVariant.fromJson(
                json_['variant'] as core.Map<core.String, core.dynamic>)
            : null,
      );