Header constructor

  1. @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
const Header({
  1. String? description,
  2. bool? required,
  3. bool? deprecated,
  4. String? style,
  5. bool? explode,
  6. Schema? schema,
  7. dynamic example,
  8. Map<String, Example>? examples,
  9. Map<String, MediaType>? content,
  10. @JsonKey.new(name: r'$ref') String? ref,
})

Creates a new instance of the Header class.

Implementation

@JsonSerializable(includeIfNull: false, explicitToJson: true)
const factory Header({
  /// A brief description of the header.
  String? description,

  /// Determines whether this header is mandatory. Default is false.
  bool? required,

  /// Specifies that the header is deprecated and
  /// SHOULD be transitioned out of usage. Default is false.
  bool? deprecated,

  /// Describes how the header value will be serialized.
  /// Only "simple" is allowed for headers.
  String? style,

  /// When true, header values of type array or
  /// object generate a single header whose value is a comma-separated list.
  bool? explode,

  /// The schema defining the type used for the header.
  Schema? schema,

  /// Example of the header's potential value.
  dynamic example,

  /// Examples of the header's potential value.
  Map<String, Example>? examples,

  /// A map containing the representations for the header.
  /// Must only contain one entry.
  Map<String, MediaType>? content,

  /// Reference to a header object.
  @JsonKey(name: r'$ref') String? ref,
}) = _Header;