ObjectSpec class final

Specification for object types with named properties.

Inheritance

Constructors

ObjectSpec({required String name, required Map<String, PropertySpec> properties, List<String> required = const [], bool additionalProperties = false, String? title, String? description, bool nullable = false, List<Object>? examples, bool isDeprecated = false})
Creates a new ObjectSpec.
const

Properties

additionalProperties → bool
Whether additional properties are allowed.
final
description → String?
Optional description of this type.
finalinherited
examples → List<Object>?
Example values for documentation.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
isDeprecated → bool
Whether this type is deprecated.
finalinherited
name → String
The name of this object type.
final
nullable → bool
Whether this type accepts null values.
finalinherited
properties → Map<String, PropertySpec>
The properties of this object, keyed by their effective name.
final
required → List<String>
Names of required properties.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
title → String?
Optional title for the schema.
final

Methods

asNullable() → ObjectSpec
Creates a copy of this spec with nullable set to true.
override
copyWith({String? name, Map<String, PropertySpec>? properties, List<String>? required, bool? additionalProperties, String? title, String? description, bool? nullable, List<Object>? examples, bool? isDeprecated}) → ObjectSpec
Creates a copy with the given modifications.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withDescription(String description) → ObjectSpec
Creates a copy of this spec with the given description.
override

Operators

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