OpenApiOperationExtensions.AddErrorResponses Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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);
static member AddErrorResponses : Microsoft.OpenApi.Models.OpenApiOperation * Microsoft.OpenApi.OData.OpenApiConvertSettings * bool * Microsoft.OpenApi.Models.OpenApiSchema -> unit
<Extension()>
Public Sub AddErrorResponses (operation As OpenApiOperation, settings As OpenApiConvertSettings, Optional addNoContent As Boolean = false, Optional schema As OpenApiSchema = Nothing)
- 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.
Toode | Versioonid |
---|---|
Open API .NET OData | latest |