Schema class final

The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object.

Inheritance

Constructors

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

Properties

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 field. Per JSON Schema, this field is intended for documentation generators and doesn't affect validation. Thus it's included here and ignored so that developers who send schemas with a default field don't get unknown-field errors.
final
description String
Optional. A brief description of the parameter. This could contain examples of use. Parameter description may be formatted as Markdown.
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. Any value is allowed, but most do not trigger any special functionality.
final
hashCode int
The hash code for this object.
no setterinherited
items Schema?
Optional. 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. Properties of Type.OBJECT.
final
propertyOrdering List<String>
Optional. The order of the properties. Not a standard field in open api spec. Used to determine the order of the properties in the response.
final
qualifiedName String
The fully qualified name of this message, i.e., google.protobuf.Duration or google.rpc.ErrorInfo.
finalinherited
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
Required. Data type.
final

Methods

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

Operators

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

Constants

fullyQualifiedName → const String