OpenApiOperationExtensions.AddErrorResponses Method

Definition

Adds a default response to the operation or 4XX/5XX responses for the errors depending on the settings. Also adds a 204 no content response when requested.

C#
public static void AddErrorResponses (this Microsoft.OpenApi.Models.OpenApiOperation operation, Microsoft.OpenApi.OData.OpenApiConvertSettings settings, bool addNoContent = false, Microsoft.OpenApi.Models.OpenApiSchema schema = default);

Parameters

operation
OpenApiOperation

The operation.

settings
OpenApiConvertSettings

The settings.

addNoContent
Boolean

Optional: Whether to add a 204 no content response.

schema
OpenApiSchema

Optional: The OpenAPI schema of the response.

Applies to

Toode Versioonid
Open API .NET OData latest