PathItem class abstract

Describes the operations available on a single path.

This class represents a path definition in an OpenAPI document, which contains one or more HTTP operations.

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

Constructors

PathItem({Operation? get, Operation? post, Operation? put, Operation? delete, Operation? patch, Operation? head, Operation? options, Operation? trace, @JsonKey.new(name: r'$ref') String? ref, String? summary, String? description, List<Server>? servers, List<Parameter>? parameters, @JsonKey.new(includeIfNull: false, includeFromJson: false, includeToJson: false) Map<String, dynamic>? extensions})
Creates a PathItem object.
const
factory
PathItem.fromJson(Map<String, dynamic> json)
Creates a PathItem from a JSON object.
factory

Properties

copyWith → $PathItemCopyWith<PathItem>
Create a copy of PathItem with the given fields replaced by the non-null parameter values.
no setterinherited
delete Operation?
The definition for the DELETE operation.
no setterinherited
description String?
An optional string description, intended to apply to all operations in this path. CommonMark syntax MAY be used for rich text representation.
no setterinherited
extensions Map<String, dynamic>?
Vendor extensions (keys like x-*).
no setterinherited
get Operation?
The definition for the GET operation.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
The definition for the HEAD operation.
no setterinherited
options Operation?
The definition for the OPTIONS operation.
no setterinherited
parameters List<Parameter>?
A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.
no setterinherited
patch Operation?
The definition for the PATCH operation.
no setterinherited
post Operation?
The definition for the POST operation.
no setterinherited
put Operation?
The definition for the PUT operation.
no setterinherited
ref String?
Allows for a referenced definition of this path item. The value MUST be in the form of a URL, and the referenced structure MUST be in the form of a Path Item Object. In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving Relative References.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
servers List<Server>?
An alternative servers array to service all operations in this path. If a servers array is specified at the OpenAPI Object level, it will be overridden by this value.
no setterinherited
summary String?
An optional string summary, intended to apply to all operations in this path.
no setterinherited
trace Operation?
The definition for the TRACE operation.
no setterinherited

Methods

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

Available on PathItem, provided by the PathItemPatterns extension

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

Available on PathItem, provided by the PathItemPatterns extension

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

Available on PathItem, provided by the PathItemPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(Operation? get, Operation? post, Operation? put, Operation? delete, Operation? patch, Operation? head, Operation? options, Operation? trace, String? ref, String? summary, String? description, List<Server>? servers, List<Parameter>? parameters, Map<String, dynamic>? extensions)?, {required TResult orElse()}) → TResult

Available on PathItem, provided by the PathItemPatterns 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 PathItem to JSON.
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(Operation? get, Operation? post, Operation? put, Operation? delete, Operation? patch, Operation? head, Operation? options, Operation? trace, String? ref, String? summary, String? description, List<Server>? servers, List<Parameter>? parameters, Map<String, dynamic>? extensions)) → TResult

Available on PathItem, provided by the PathItemPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(Operation? get, Operation? post, Operation? put, Operation? delete, Operation? patch, Operation? head, Operation? options, Operation? trace, String? ref, String? summary, String? description, List<Server>? servers, List<Parameter>? parameters, Map<String, dynamic>? extensions)?) → TResult?

Available on PathItem, provided by the PathItemPatterns extension

A variant of when that fallback to returning null

Operators

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