Schema class final
The definition of an input or output data types.
These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object.
Constructors
-
Schema(SchemaType type, {String? format, String? description, String? title, bool? nullable, List<
String> ? enumValues, Schema? items, int? minItems, int? maxItems, double? minimum, double? maximum, Map<String, Schema> ? properties, List<String> ? optionalProperties, List<String> ? propertyOrdering, List<Schema> ? anyOf}) -
Schema.anyOf({required List<
Schema> schemas}) - Construct a schema representing a value that must conform to any (one or more) of the provided sub-schemas.
- Schema.array({required Schema items, String? description, String? title, bool? nullable, int? minItems, int? maxItems})
- Construct a schema for an array of values with a specified type.
- Schema.boolean({String? description, String? title, bool? nullable})
- Construct a schema for bool value.
-
Schema.enumString({required List<
String> enumValues, String? description, String? title, bool? nullable}) - Construct a schema for String value with enumerated possible values.
- Schema.integer({String? description, String? title, bool? nullable, String? format, int? minimum, int? maximum})
- Construct a schema for an integer number.
- Schema.number({String? description, String? title, bool? nullable, String? format, double? minimum, double? maximum})
- Construct a schema for a non-integer number.
-
Schema.object({required Map<
String, Schema> properties, List<String> ? optionalProperties, List<String> ? propertyOrdering, String? description, String? title, bool? nullable}) - Construct a schema for an object with one or more properties.
- Schema.string({String? description, String? title, bool? nullable, String? format})
- Construct a schema for a String value.
Properties
-
anyOf
↔ List<
Schema> ? -
An array of Schema objects to validate generated content.
getter/setter pair
- description ↔ String?
-
A brief description of the parameter.
getter/setter pair
-
enumValues
↔ List<
String> ? -
Possible values if this is a SchemaType.string with an enum format.
getter/setter pair
- format ↔ String?
-
The format of the data.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- items ↔ Schema?
-
Schema for the elements if this is a SchemaType.array.
getter/setter pair
- maximum ↔ double?
-
The maximum value of a numeric type.
getter/setter pair
- maxItems ↔ int?
-
An integer specifying the maximum number of items SchemaType.array must contain.
getter/setter pair
- minimum ↔ double?
-
The minimum value of a numeric type.
getter/setter pair
- minItems ↔ int?
-
An integer specifying the minimum number of items SchemaType.array must contain.
getter/setter pair
- nullable ↔ bool?
-
Whether the value may be null.
getter/setter pair
-
optionalProperties
↔ List<
String> ? -
Optional Properties if this is a SchemaType.object.
getter/setter pair
-
properties
↔ Map<
String, Schema> ? -
Properties of this type if this is a SchemaType.object.
getter/setter pair
-
propertyOrdering
↔ List<
String> ? -
Suggesting order of the properties.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title ↔ String?
-
A human-readable name/summary for the schema or a specific property.
getter/setter pair
- type ↔ SchemaType
-
The type of this value.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object> - Convert to json object.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited