Schema class

A supported subset of JSON Schema used by OpenTool function signatures.

type keeps the legacy single type value. Union schemas expose the complete set through typeUnion. Composition is supported through oneOf, anyOf, and allOf.

Constructors

Schema({required String type, List<String>? typeUnion, String? description, Map<String, Schema>? properties, Schema? items, Object? additionalProperties, List<Object?>? enum_, List<String>? required, List<Schema>? oneOf, List<Schema>? anyOf, List<Schema>? allOf})
Schema.fromJson(Map<String, dynamic> json)
factory

Properties

additionalProperties ↔ Object?
additionalProperties can be a boolean or a schema.
getter/setter pair
allOf ↔ List<Schema>?
getter/setter pair
anyOf ↔ List<Schema>?
getter/setter pair
description ↔ String?
getter/setter pair
enum_ ↔ List<Object?>?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasType → bool
Whether the input schema contained a type keyword.
no setter
items ↔ Schema?
getter/setter pair
oneOf ↔ List<Schema>?
getter/setter pair
properties ↔ Map<String, Schema>?
getter/setter pair
required ↔ List<String>?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type ↔ String
The legacy single type field. For a union, this is the first member. Read typeUnion to get every member of a union type.
getter/setter pair
typeUnion ↔ List<String>?
getter/setter pair

Methods

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

Operators

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