SchemaProperty class
Represents a JSON Schema property with its type, constraints, and metadata.
Constructors
-
SchemaProperty({required String name, required List<
String> types, String? description, num? minimum, num? maximum, String? pattern, String? format, List? enumValues, Map<String, dynamic> ? items, bool isRequired = false}) -
const
-
SchemaProperty.fromJson(String name, Map<
String, dynamic> json, bool isRequired) -
Creates a SchemaProperty from a JSON property definition
factory
Properties
- description → String?
-
Description of the property
final
- enumValues → List?
-
Allowed enum values
final
- format → String?
-
Format specification (e.g., "date")
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isArray → bool
-
Returns true if this property is an array type
no setter
- isBoolean → bool
-
Returns true if this property is a boolean type
no setter
- isNullable → bool
-
Returns true if this property can be null
no setter
- isNumber → bool
-
Returns true if this property is a number type
no setter
- isRequired → bool
-
Whether this property is required
final
- isString → bool
-
Returns true if this property is a string type
no setter
-
items
→ Map<
String, dynamic> ? -
Type specification for array items
final
- maximum → num?
-
Maximum value (for numbers)
final
- minimum → num?
-
Minimum value (for numbers)
final
- name → String
-
The name of the property
final
- pattern → String?
-
Regular expression pattern (for strings)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
types
→ List<
String> -
List of allowed types (e.g.,
"string", "null")final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override