BoolSchema class final

Matches JSON booleans.

Inheritance

Constructors

BoolSchema()
const

Properties

defaultValue → Object?
The default supplied when providesDefault is true.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isOptional → bool
Whether an object field using this schema may be omitted entirely.
no setterinherited
providesDefault → bool
Whether this schema supplies a default when the value is missing.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

describe(String description) → Schema<bool>
Attaches a description, included in toJsonSchema. Descriptions are the main way to tell an LLM what a field means — use them liberally.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable() → Schema<bool?>
Accepts null in addition to values matching this schema.
inherited
optional() → Schema<bool>
Marks an object field as omittable. When the key is absent the field is left out of the resulting map (no error is reported).
inherited
parse(Object? input) → bool
Validates a decoded JSON value, throwing SchemaValidationException on failure.
inherited
parseText(String text) → bool
Extracts JSON from raw LLM text and validates it, throwing SchemaValidationException on failure.
inherited
refine(bool predicate(bool value), {String? message}) → Schema<bool>
Adds a custom check on the validated value.
inherited
safeParse(Object? input) → SchemaResult<bool>
Validates a decoded JSON value. Never throws; returns a SchemaSuccess or a SchemaFailure carrying every issue found.
inherited
safeParseText(String text) → SchemaResult<bool>
Extracts JSON from raw LLM text and validates it. Never throws.
inherited
toJsonSchema() → Map<String, Object?>
This schema expressed as a JSON Schema map, suitable for LLM tool-parameter definitions and structured-output APIs.
override
toJsonSchemaString({bool pretty = false}) → String
toJsonSchema encoded as a JSON string.
inherited
toString() → String
A string representation of this object.
inherited
transform<R>(R mapper(bool value)) → Schema<R>
Maps the validated value with mapper. Exceptions thrown by mapper are converted into validation issues.
inherited
validateAt(Object? input, List<Object> path) → SchemaResult<bool>
Validates input located at path within a larger document.
override
withDefault(bool value) → Schema<bool>
Uses value when the input is null or the object key is absent.
inherited

Operators

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