Components class abstract

An object to hold reusable objects for the specification.

This class represents the components section of an OpenAPI document, where reusable schemas, responses, parameters, and other objects are defined.

Available extensions
Annotations
  • @Freezed.new(copyWith: true, fromJson: true, toJson: false, equal: true)

Constructors

Components({Map<String, Schema>? schemas, Map<String, Response>? responses, Map<String, Parameter>? parameters, Map<String, RequestBody>? requestBodies, Map<String, SecurityScheme>? securitySchemes, Map<String, Header>? headers, Map<String, Link>? links, Map<String, Callback>? callbacks, Map<String, PathItem>? pathItems, @JsonKey.new(includeIfNull: false, includeFromJson: false, includeToJson: false) Map<String, dynamic>? extensions, Map<String, Example>? examples})
Creates a Components object.
const
factory
Components.fromJson(Map<String, dynamic> json)
Creates a Components from a JSON object.
factory

Properties

callbacks → Map<String, Callback>?
The callbacks available for reuse.
no setterinherited
copyWith → $ComponentsCopyWith<Components>
Create a copy of Components with the given fields replaced by the non-null parameter values.
no setterinherited
examples → Map<String, Example>?
An object to hold reusable Example Objects.
no setterinherited
extensions → Map<String, dynamic>?
Vendor extensions (keys like x-*).
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, Header>?
The headers available for reuse.
no setterinherited
An object to hold reusable Link Objects.
no setterinherited
parameters → Map<String, Parameter>?
The parameters available for reuse.
no setterinherited
pathItems → Map<String, PathItem>?
The path items available for reuse.
no setterinherited
requestBodies → Map<String, RequestBody>?
The request bodies available for reuse.
no setterinherited
responses → Map<String, Response>?
The responses available for reuse.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemas → Map<String, Schema>?
The schemas available for reuse.
no setterinherited
securitySchemes → Map<String, SecurityScheme>?
The security schemes available for reuse.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Components value)) → TResult

Available on Components, provided by the ComponentsPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Components value)?) → TResult?

Available on Components, provided by the ComponentsPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Components value)?, {required TResult orElse()}) → TResult

Available on Components, provided by the ComponentsPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(Map<String, Schema>? schemas, Map<String, Response>? responses, Map<String, Parameter>? parameters, Map<String, RequestBody>? requestBodies, Map<String, SecurityScheme>? securitySchemes, Map<String, Header>? headers, Map<String, Link>? links, Map<String, Callback>? callbacks, Map<String, PathItem>? pathItems, Map<String, dynamic>? extensions, Map<String, Example>? examples)?, {required TResult orElse()}) → TResult

Available on Components, provided by the ComponentsPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this Components object to a JSON map.
toString() → String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(Map<String, Schema>? schemas, Map<String, Response>? responses, Map<String, Parameter>? parameters, Map<String, RequestBody>? requestBodies, Map<String, SecurityScheme>? securitySchemes, Map<String, Header>? headers, Map<String, Link>? links, Map<String, Callback>? callbacks, Map<String, PathItem>? pathItems, Map<String, dynamic>? extensions, Map<String, Example>? examples)) → TResult

Available on Components, provided by the ComponentsPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(Map<String, Schema>? schemas, Map<String, Response>? responses, Map<String, Parameter>? parameters, Map<String, RequestBody>? requestBodies, Map<String, SecurityScheme>? securitySchemes, Map<String, Header>? headers, Map<String, Link>? links, Map<String, Callback>? callbacks, Map<String, PathItem>? pathItems, Map<String, dynamic>? extensions, Map<String, Example>? examples)?) → TResult?

Available on Components, provided by the ComponentsPatterns extension

A variant of when that fallback to returning null

Operators

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