Response constructor

  1. @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
const Response({
  1. required String description,
  2. Schema? schema,
  3. Map<String, MediaType>? content,
  4. Map<String, Header>? headers,
  5. @JsonKey.new(name: r'$ref') String? ref,
})

Creates a Response object.

Implementation

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

  /// The response schema for OpenAPI 2.0.
  Schema? schema,

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

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

  /// The reference to the response schema.
  @JsonKey(name: r'$ref') String? ref,
}) = _Response;