SchemaTypeAndFormat

June 7, 2023 ยท View on GitHub

Category

Data Plane Warning

Applies to

Data Plane OpenAPI specs

Output Message

Schema with type: {{type}} has unrecognized format: {{format}}

Description

Every schema should specify a well-defined combination of type and format.

format is required for type integer and number, optional for type string, and not allowed for any other types.

The well-defined type/format combinations are:

type: integer

formatdescriptioncomments
int32signed 32 bitsfrom oas2
int64signed 64 bitsfrom oas2
unixtimeUnix time stampfrom AutoRest

type: number

formatdescriptioncomments
float32 bit floating pointfrom oas2
int6464 bit floating pointfrom oas2
decimal128 bit floating pointfrom AutoRest

type: string

formatdescriptioncomments
bytebase64 encoded charactersfrom oas2
binaryany sequence of octetsfrom oas2
dateRFC3339 full-datefrom oas2
date-timeRFC3339 date-timefrom oas2
passwordsensitive valuefrom oas2
charfrom AutoRest
timefrom AutoRest
date-time-rfc1123from AutoRest
date-time-rfc7231from AutoRest
durationfrom AutoRest
uuidfrom AutoRest
base64urlfrom AutoRest
urlfrom AutoRest
urifrom AutoRest
odata-queryfrom AutoRest
certificatefrom AutoRest

CreatedAt

July 21, 2022

LastModifiedAt

July 21, 2022

How to fix the violation

Change the schema to use a well-defined type and format.