Operation constructor

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

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 short summary of what the operation does.
  String? summary,

  /// A verbose explanation of the operation behavior.
  /// CommonMark syntax MAY be used for rich text representation.
  String? description,

  /// Additional external documentation for this operation.
  ExternalDocs? externalDocs,

  /// 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,

  /// Specifies whether the operation is deprecated.
  bool? deprecated,

  /// An alternative servers array to service this operation.
  /// If a servers array is specified at the Path Item Object or
  /// OpenAPI Object level, it will be overridden by this value.
  List<Server>? servers,
}) = _Operation;