Response constructor

  1. @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
const Response({
  1. required String description,
  2. Map<String, MediaType>? content,
  3. Map<String, Header>? headers,
  4. Map<String, Link>? links,
  5. @JsonKey.new(includeIfNull: false, includeFromJson: false, includeToJson: false) Map<String, dynamic>? extensions,
})

Creates a Response object.

Implementation

@JsonSerializable(includeIfNull: false, explicitToJson: true)
const factory Response({
  /// A brief description of the response.
  required String description,

  /// The content of the response for OpenAPI 3.0.
  Map<String, MediaType>? content,

  /// A map of headers for this response.
  Map<String, Header>? headers,

  /// A map of operations links that can be followed from the response.
  /// The key of the map is a short name for the link,
  /// following the naming constraints of the names for Component Objects.
  Map<String, Link>? links,

  /// Vendor extensions (keys like `x-*`).
  @JsonKey(includeIfNull: false, includeFromJson: false, includeToJson: false)
  Map<String, dynamic>? extensions,
}) = _Response;