Operation constructor

  1. @JsonSerializable.new(includeIfNull: false, explicitToJson: true)
const Operation({
  1. @Default.new([]) List<String> tags,
  2. String? summary,
  3. String? description,
  4. String? operationId,
  5. @Default.new([]) List<Parameter> parameters,
  6. RequestBody? requestBody,
  7. @Default.new({}) Map<String, Response> responses,
  8. @Default.new([]) List<SecurityRequirement> security,
  9. List<String>? consumes,
  10. List<String>? produces,
  11. bool? deprecated,
})

Creates an Operation object.

Implementation

@JsonSerializable(includeIfNull: false, explicitToJson: true)
const factory Operation({
  /// A list of tags for API documentation.
  @Default([]) List<String> tags,

  /// A brief summary of the operation.
  String? summary,

  /// A detailed description of the operation.
  String? description,

  /// A unique string used to identify the operation.
  String? operationId,

  /// A list of parameters for the operation.
  @Default([]) List<Parameter> parameters,

  /// The request body of the operation.
  RequestBody? requestBody,

  /// The possible responses for the operation.
  @Default({}) Map<String, Response> responses,

  /// A declaration of which security schemes are required for this operation.
  @Default([]) List<SecurityRequirement> security,

  /// A list of MIME types the operation can consume (OpenAPI 2.0).
  List<String>? consumes,

  /// A list of MIME types the operation can produce (OpenAPI 2.0).
  List<String>? produces,

  /// Specifies whether the operation is deprecated.
  bool? deprecated,
}) = _Operation;