OpenApiDocDescriptor.NewOpenApiHeader method

Creates a new OpenApiHeader with the specified properties.

public OpenApiHeader NewOpenApiHeader(string? description = null, bool required = false, 
    bool deprecated = false, bool allowEmptyValue = false, ParameterStyle? style = default, 
    bool explode = false, bool allowReserved = false, object? example = null, 
    Hashtable? examples = null, Type? schema = null, IDictionary? content = null, 
    IDictionary? extensions = null)
parameter description
description The description of the header.
required Indicates whether the header is required.
deprecated Indicates whether the header is deprecated.
allowEmptyValue Indicates whether empty values are allowed.
style The style of the header.
explode Indicates whether the header should be exploded.
allowReserved Indicates whether the header allows reserved characters.
example An example of the header’s value.
examples A collection of examples for the header.
schema The schema of the header.
content The content of the header.
extensions A collection of extensions for the header.

Return Value

A new instance of OpenApiHeader with the specified properties.

Exceptions

exception condition
InvalidOperationException Thrown when header examples keys or values are invalid.

See Also