Schema class abstract
The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays
https://swagger.io/specification/#schema-object https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md
- Available extensions
- Annotations
-
- @Freezed.new(unionKey: 'type', fallbackUnion: 'object')
Constructors
- Schema.array({Xml? xml, String? title, String? description, @JsonKey.new(name: 'default') List? defaultValue, bool? nullable, dynamic example, @JsonKey.new(fromJson: _fromJsonInt) int? minItems, @JsonKey.new(fromJson: _fromJsonInt) int? maxItems, required Schema items, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref})
-
A generic Schema of array type
constfactory
- Schema.boolean({Xml? xml, String? title, String? description, @JsonKey.new(name: 'default') bool? defaultValue, bool? nullable, bool? example, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref})
-
constfactory
-
Schema.enumeration({String? title, String? description, String? example, @JsonKey.new(name: 'default') String? defaultValue, bool? nullable, @JsonKey.new(includeToJson: false, includeFromJson: false) String? unknownValue, @JsonKey.new(name: 'enum') List<
String> ? values, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref}) -
constfactory
-
Schema.fromJson(Map<
String, dynamic> json) -
Convert from JSON representation
factory
- Schema.integer({Xml? xml, String? title, String? description, @JsonKey.new(name: 'default', fromJson: _fromJsonInt) int? defaultValue, bool? nullable, @JsonKey.new(unknownEnumValue: JsonKey.nullForUndefinedEnumValue) IntegerFormat? format, @JsonKey.new(fromJson: _fromJsonInt) int? example, @JsonKey.new(fromJson: _fromJsonInt) int? minimum, @JsonKey.new(fromJson: _fromJsonInt) int? maximum, @JsonKey.new(fromJson: _fromJsonInt) int? exclusiveMinimum, @JsonKey.new(fromJson: _fromJsonInt) int? exclusiveMaximum, @JsonKey.new(fromJson: _fromJsonInt) int? multipleOf, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref})
-
An integer schema property
constfactory
- Schema.map({Xml? xml, String? title, String? description, @JsonKey.new(name: 'default') Map? defaultValue, bool? nullable, Map? example, @JsonKey.new(name: 'additionalProperties', toJson: _toMapProps, fromJson: _fromMapProps) Schema? valueSchema, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref})
-
A generic Schema of map type
constfactory
- Schema.number({Xml? xml, String? title, String? description, @JsonKey.new(name: 'default', fromJson: _fromJsonDouble) double? defaultValue, bool? nullable, @JsonKey.new(unknownEnumValue: JsonKey.nullForUndefinedEnumValue) NumberFormat? format, @JsonKey.new(fromJson: _fromJsonDouble) double? example, @JsonKey.new(fromJson: _fromJsonDouble) double? minimum, @JsonKey.new(fromJson: _fromJsonDouble) double? maximum, @JsonKey.new(fromJson: _fromJsonInt) int? exclusiveMinimum, @JsonKey.new(fromJson: _fromJsonInt) int? exclusiveMaximum, @JsonKey.new(fromJson: _fromJsonDouble) double? multipleOf, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref})
-
A number schema property
constfactory
-
Schema.object({String? title, String? description, @JsonKey.new(name: 'default') dynamic defaultValue, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref, @_SchemaListConverter.new() List<
Schema> ? allOf, @_SchemaListConverter.new() List<Schema> ? oneOf, @_SchemaListConverter.new() List<Schema> ? anyOf, List<String> ? required, Discriminator? discriminator, ExternalDocs? externalDocs, Map<String, Schema> ? properties, bool? nullable, Xml? xml}) -
constfactory
- Schema.string({Xml? xml, String? title, String? description, @JsonKey.new(name: 'default') String? defaultValue, bool? nullable, @JsonKey.new(unknownEnumValue: JsonKey.nullForUndefinedEnumValue) StringFormat? format, String? pattern, String? example, @JsonKey.new(fromJson: _fromJsonInt) int? minLength, @JsonKey.new(fromJson: _fromJsonInt) int? maxLength, @JsonKey.new(fromJson: _fromJsonInt) int? exclusiveMinimum, @JsonKey.new(fromJson: _fromJsonInt) int? exclusiveMaximum, @JsonKey.new(name: '\$ref') @_SchemaRefConverter.new() String? ref})
-
constfactory
Properties
-
copyWith
→ $SchemaCopyWith<
Schema> -
Create a copy of Schema
with the given fields replaced by the non-null parameter values.
no setterinherited
- defaultValue → dynamic
-
The default value code to place into
@Default()no setterinherited - description → String?
-
A short description of the schema
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- nullable → bool?
-
Define if this scheme is nullable
no setterinherited
- ref → String?
-
Reference to a schema definition
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String?
-
A summary title of the schema
no setterinherited
- type → SchemaType
-
Get the schema type based on the union type
no setter
Methods
-
dereference(
{required Map< String, Schema> ? components}) → Schema -
map<
TResult extends Object?> ({required TResult object(SchemaObject value), required TResult boolean(SchemaBoolean value), required TResult string(SchemaString value), required TResult integer(SchemaInteger value), required TResult number(SchemaNumber value), required TResult enumeration(SchemaEnum value), required TResult array(SchemaArray value), required TResult map(SchemaMap value)}) → TResult -
Available on Schema, provided by the SchemaPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? object(SchemaObject value)?, TResult? boolean(SchemaBoolean value)?, TResult? string(SchemaString value)?, TResult? integer(SchemaInteger value)?, TResult? number(SchemaNumber value)?, TResult? enumeration(SchemaEnum value)?, TResult? array(SchemaArray value)?, TResult? map(SchemaMap value)?}) → TResult? -
Available on Schema, provided by the SchemaPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult object(SchemaObject value)?, TResult boolean(SchemaBoolean value)?, TResult string(SchemaString value)?, TResult integer(SchemaInteger value)?, TResult number(SchemaNumber value)?, TResult enumeration(SchemaEnum value)?, TResult array(SchemaArray value)?, TResult map(SchemaMap value)?, required TResult orElse()}) → TResult -
Available on Schema, provided by the SchemaPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> ({TResult object(String? title, String? description, dynamic defaultValue, String? ref, List< Schema> ? allOf, List<Schema> ? oneOf, List<Schema> ? anyOf, List<String> ? required, Discriminator? discriminator, ExternalDocs? externalDocs, Map<String, Schema> ? properties, bool? nullable, Xml? xml)?, TResult boolean(Xml? xml, String? title, String? description, bool? defaultValue, bool? nullable, bool? example, String? ref)?, TResult string(Xml? xml, String? title, String? description, String? defaultValue, bool? nullable, StringFormat? format, String? pattern, String? example, int? minLength, int? maxLength, int? exclusiveMinimum, int? exclusiveMaximum, String? ref)?, TResult integer(Xml? xml, String? title, String? description, int? defaultValue, bool? nullable, IntegerFormat? format, int? example, int? minimum, int? maximum, int? exclusiveMinimum, int? exclusiveMaximum, int? multipleOf, String? ref)?, TResult number(Xml? xml, String? title, String? description, double? defaultValue, bool? nullable, NumberFormat? format, double? example, double? minimum, double? maximum, int? exclusiveMinimum, int? exclusiveMaximum, double? multipleOf, String? ref)?, TResult enumeration(String? title, String? description, String? example, String? defaultValue, bool? nullable, String? unknownValue, List<String> ? values, String? ref)?, TResult array(Xml? xml, String? title, String? description, List? defaultValue, bool? nullable, dynamic example, int? minItems, int? maxItems, Schema items, String? ref)?, TResult map(Xml? xml, String? title, String? description, Map? defaultValue, bool? nullable, Map? example, Schema? valueSchema, String? ref)?, required TResult orElse()}) → TResult -
Available on Schema, provided by the SchemaPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDartType(
{Map< String, List< ? unions}) → StringString> > - Return a proper Dart type for this schema
-
toJson(
) → Map< String, dynamic> -
Serializes this Schema to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult object(String? title, String? description, dynamic defaultValue, String? ref, List< Schema> ? allOf, List<Schema> ? oneOf, List<Schema> ? anyOf, List<String> ? required, Discriminator? discriminator, ExternalDocs? externalDocs, Map<String, Schema> ? properties, bool? nullable, Xml? xml), required TResult boolean(Xml? xml, String? title, String? description, bool? defaultValue, bool? nullable, bool? example, String? ref), required TResult string(Xml? xml, String? title, String? description, String? defaultValue, bool? nullable, StringFormat? format, String? pattern, String? example, int? minLength, int? maxLength, int? exclusiveMinimum, int? exclusiveMaximum, String? ref), required TResult integer(Xml? xml, String? title, String? description, int? defaultValue, bool? nullable, IntegerFormat? format, int? example, int? minimum, int? maximum, int? exclusiveMinimum, int? exclusiveMaximum, int? multipleOf, String? ref), required TResult number(Xml? xml, String? title, String? description, double? defaultValue, bool? nullable, NumberFormat? format, double? example, double? minimum, double? maximum, int? exclusiveMinimum, int? exclusiveMaximum, double? multipleOf, String? ref), required TResult enumeration(String? title, String? description, String? example, String? defaultValue, bool? nullable, String? unknownValue, List<String> ? values, String? ref), required TResult array(Xml? xml, String? title, String? description, List? defaultValue, bool? nullable, dynamic example, int? minItems, int? maxItems, Schema items, String? ref), required TResult map(Xml? xml, String? title, String? description, Map? defaultValue, bool? nullable, Map? example, Schema? valueSchema, String? ref)}) → TResult -
Available on Schema, provided by the SchemaPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> ({TResult? object(String? title, String? description, dynamic defaultValue, String? ref, List< Schema> ? allOf, List<Schema> ? oneOf, List<Schema> ? anyOf, List<String> ? required, Discriminator? discriminator, ExternalDocs? externalDocs, Map<String, Schema> ? properties, bool? nullable, Xml? xml)?, TResult? boolean(Xml? xml, String? title, String? description, bool? defaultValue, bool? nullable, bool? example, String? ref)?, TResult? string(Xml? xml, String? title, String? description, String? defaultValue, bool? nullable, StringFormat? format, String? pattern, String? example, int? minLength, int? maxLength, int? exclusiveMinimum, int? exclusiveMaximum, String? ref)?, TResult? integer(Xml? xml, String? title, String? description, int? defaultValue, bool? nullable, IntegerFormat? format, int? example, int? minimum, int? maximum, int? exclusiveMinimum, int? exclusiveMaximum, int? multipleOf, String? ref)?, TResult? number(Xml? xml, String? title, String? description, double? defaultValue, bool? nullable, NumberFormat? format, double? example, double? minimum, double? maximum, int? exclusiveMinimum, int? exclusiveMaximum, double? multipleOf, String? ref)?, TResult? enumeration(String? title, String? description, String? example, String? defaultValue, bool? nullable, String? unknownValue, List<String> ? values, String? ref)?, TResult? array(Xml? xml, String? title, String? description, List? defaultValue, bool? nullable, dynamic example, int? minItems, int? maxItems, Schema items, String? ref)?, TResult? map(Xml? xml, String? title, String? description, Map? defaultValue, bool? nullable, Map? example, Schema? valueSchema, String? ref)?}) → TResult? -
Available on Schema, provided by the SchemaPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited