Parameter class abstract

Describes a single operation parameter.

A unique parameter is defined by a combination of a name and location.

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

Constructors

Parameter.new({@JsonKey(name: r'$ref') String? ref, String? name, @JsonKey(name: 'in') ParameterLocation? location, String? description, bool? required, bool? deprecated, Schema? schema, String? type, String? format, String? collectionFormat, Schema? items, num? maximum, num? minimum, bool? explode})
Creates a Parameter object.
const
factory
Parameter.fromJson(Map<String, dynamic> json)
Creates a Parameter from a JSON object.
factory

Properties

collectionFormat String?
The collection format for array parameters (OpenAPI 2.0).
no setterinherited
copyWith → $ParameterCopyWith<Parameter>
Create a copy of Parameter with the given fields replaced by the non-null parameter values.
no setterinherited
deprecated bool?
Specifies whether the parameter is deprecated.
no setterinherited
description String?
A brief description of the parameter.
no setterinherited
explode bool?
Specifies whether array or object parameters should be exploded.
no setterinherited
format String?
The format of the parameter's value (OpenAPI 2.0).
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
items Schema?
For array types, describes the type of items in the array (OpenAPI 2.0).
no setterinherited
location ParameterLocation?
The location of the parameter, typically query, header, path, or cookie.
no setterinherited
maximum num?
The maximum allowed value for a numeric parameter.
no setterinherited
minimum num?
The minimum allowed value for a numeric parameter.
no setterinherited
name String?
The name of the parameter.
no setterinherited
ref String?
A reference to a Parameter Object, typically in the components section. If this field is non-null, all other fields must be null.
no setterinherited
required bool?
Specifies whether the parameter is required.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema Schema?
Specifies the schema of the parameter's value (OpenAPI 3.0).
no setterinherited
type String?
The data type of the parameter (OpenAPI 2.0).
no setterinherited

Methods

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

Available on Parameter, provided by the ParameterPatterns extension

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

Available on Parameter, provided by the ParameterPatterns extension

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

Available on Parameter, provided by the ParameterPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String? ref, String? name, ParameterLocation? location, String? description, bool? required, bool? deprecated, Schema? schema, String? type, String? format, String? collectionFormat, Schema? items, num? maximum, num? minimum, bool? explode)?, {required TResult orElse()}) → TResult

Available on Parameter, provided by the ParameterPatterns 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>
Serializes this Parameter to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String? ref, String? name, ParameterLocation? location, String? description, bool? required, bool? deprecated, Schema? schema, String? type, String? format, String? collectionFormat, Schema? items, num? maximum, num? minimum, bool? explode)) → TResult

Available on Parameter, provided by the ParameterPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String? ref, String? name, ParameterLocation? location, String? description, bool? required, bool? deprecated, Schema? schema, String? type, String? format, String? collectionFormat, Schema? items, num? maximum, num? minimum, bool? explode)?) → TResult?

Available on Parameter, provided by the ParameterPatterns extension

A variant of when that fallback to returning null

Operators

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