Logo Orsak

ResponseDescription Type

A response an endpoint can give: its status code, the type of its body, if it has one, and what it means. As endpoint metadata, it is an IProducesResponseTypeMetadata, which ApiExplorer and OpenAPI generators read.

Record fields

Record Field Description

BodyType

Full Usage: BodyType

Field type: Type option

The type of the response's body, if it has one.

Field type: Type option

ContentTypes

Full Usage: ContentTypes

Field type: string list

The content types of the body.

Field type: string list

Description

Full Usage: Description

Field type: string option

What the response means, such as "No order has the id".

Field type: string option

StatusCode

Full Usage: StatusCode

Field type: int

The status code of the response.

Field type: int

Static members

Static member Description

ResponseDescription.Empty(statusCode, ?description)

Full Usage: ResponseDescription.Empty(statusCode, ?description)

Parameters:
    statusCode : int - The status code of the response
    ?description : string - What the response means

Returns: ResponseDescription

A response without a body.

statusCode : int

The status code of the response

?description : string

What the response means

Returns: ResponseDescription

ResponseDescription.Json(statusCode, bodyType, ?description)

Full Usage: ResponseDescription.Json(statusCode, bodyType, ?description)

Parameters:
    statusCode : int - The status code of the response
    bodyType : Type - The type of the body
    ?description : string - What the response means

Returns: ResponseDescription

A response with a JSON body of type bodyType.

statusCode : int

The status code of the response

bodyType : Type

The type of the body

?description : string

What the response means

Returns: ResponseDescription

Type something to start searching.