Class ApiOperation
One contract operation as the generated code describes it: its id, its success statuses
(usually one; e.g. 201, 202 for a create that may queue) and the error statuses it
declares. Attached to each generated endpoint as metadata, so middleware can answer in the
contract's terms (see BindingFailureMiddleware).
public sealed record ApiOperation : IEquatable<ApiOperation>
- Inheritance
-
ApiOperation
- Implements
- Inherited Members
Constructors
ApiOperation(string, IReadOnlyList<int>, IReadOnlyList<int>)
One contract operation as the generated code describes it: its id, its success statuses
(usually one; e.g. 201, 202 for a create that may queue) and the error statuses it
declares. Attached to each generated endpoint as metadata, so middleware can answer in the
contract's terms (see BindingFailureMiddleware).
public ApiOperation(string OperationId, IReadOnlyList<int> SuccessStatuses, IReadOnlyList<int> ErrorStatuses)
Parameters
OperationIdstringThe operation id, as in the OpenAPI document.
SuccessStatusesIReadOnlyList<int>The declared 2xx statuses, in contract order.
ErrorStatusesIReadOnlyList<int>The declared error statuses.
Properties
ErrorStatuses
The declared error statuses.
public IReadOnlyList<int> ErrorStatuses { get; init; }
Property Value
OperationId
The operation id, as in the OpenAPI document.
public string OperationId { get; init; }
Property Value
SuccessStatus
The first (for most operations, the only) declared success status.
public int SuccessStatus { get; }
Property Value
SuccessStatuses
The declared 2xx statuses, in contract order.
public IReadOnlyList<int> SuccessStatuses { get; init; }
Property Value
Methods
Declares(int)
Whether the contract declares status for this operation.
public bool Declares(int status)
Parameters
statusint