OpenApiTypeMapper.MapTypeToOpenApiPrimitiveType(Type) Method

Definition

Maps a simple type to an OpenAPI data type and format.

public static Microsoft.OpenApi.Models.OpenApiSchema MapTypeToOpenApiPrimitiveType (this Type type);
static member MapTypeToOpenApiPrimitiveType : Type -> Microsoft.OpenApi.Models.OpenApiSchema
<Extension()>
Public Function MapTypeToOpenApiPrimitiveType (type As Type) As OpenApiSchema

Parameters

type
Type

Simple type.

Returns

Remarks

All the following types from http://swagger.io/specification/#data-types-12 are supported. Other types including nullables and URL are also supported. Common Name type format Comments =========== ======= ====== ========================================= integer integer int32 signed 32 bits long integer int64 signed 64 bits float number float double number double string string [empty] byte string byte base64 encoded characters binary string binary any sequence of octets boolean boolean [empty] date string date As defined by full-date - RFC3339 dateTime string date-time As defined by date-time - RFC3339 password string password Used to hint UIs the input needs to be obscured. If the type is not recognized as "simple", System.String will be returned.

Applies to