Schema class final

Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed.

Constructors

Schema({Type type = Type.$default, String format = '', String title = '', String description = '', bool nullable = false, Value? default$, Schema? items, int minItems = 0, int maxItems = 0, List<String> enum$ = const [], Map<String, Schema> properties = const {}, List<String> propertyOrdering = const [], List<String> required = const [], int minProperties = 0, int maxProperties = 0, double minimum = 0, double maximum = 0, int minLength = 0, int maxLength = 0, String pattern = '', Value? example, List<Schema> anyOf = const [], Value? additionalProperties, String ref = '', Map<String, Schema> defs = const {}})
Schema.fromJson(Object? j)
factory

Properties

additionalProperties → Value?
Optional. Can either be a boolean or an object; controls the presence of additional properties.
final
anyOf → List<Schema>
Optional. The value should be validated against any (one or more) of the subschemas in the list.
final
default$ → Value?
Optional. Default value of the data.
final
defs → Map<String, Schema>
Optional. A map of definitions for use by ref Only allowed at the root of the schema.
final
description → String
Optional. The description of the data.
final
enum$ → List<String>
Optional. Possible values of the element of Type.STRING with enum format. For example we can define an Enum Direction as : {type:STRING, format:enum, enum:"EAST", NORTH", "SOUTH", "WEST"}
final
example → Value?
Optional. Example of the object. Will only populated when the object is the root.
final
format → String
Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
final
hashCode → int
The hash code for this object.
no setterinherited
items → Schema?
Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
final
maximum → double
Optional. Maximum value of the Type.INTEGER and Type.NUMBER
final
maxItems → int
Optional. Maximum number of the elements for Type.ARRAY.
final
maxLength → int
Optional. Maximum length of the Type.STRING
final
maxProperties → int
Optional. Maximum number of the properties for Type.OBJECT.
final
minimum → double
Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
final
minItems → int
Optional. Minimum number of the elements for Type.ARRAY.
final
minLength → int
Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
final
minProperties → int
Optional. Minimum number of the properties for Type.OBJECT.
final
nullable → bool
Optional. Indicates if the value may be null.
final
pattern → String
Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
final
properties → Map<String, Schema>
Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
final
propertyOrdering → List<String>
Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
final
qualifiedName → String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
ref → String
Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root defs.
final
required → List<String>
Optional. Required properties of Type.OBJECT.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
title → String
Optional. The title of the Schema.
final
type → Type
Optional. The type of the data.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Object
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

fullyQualifiedName → const String