Linter rulesSwagger 2.0schema-format-deprecated

schema-format-deprecated

Since 0.10.0

This rule reports the formats which the OpenAPI format registry marks as deprecated from OpenAPI 3.1, and names what replaces them.

Rule Details

Format Use instead
byte contentEncoding: base64
base64url contentEncoding: base64url
binary contentMediaType, or the media type of the body or part without a schema

Swagger 2.0 has no replacement for these formats, so the issues are always hints: they mark what needs a change when the document is converted to OpenAPI 3.1, and never count as warnings. See Formats for every format.

Configuration

None.

Examples

Good.

swagger: '2.0'
definitions:
  Avatar:
    type: string

Bad.

swagger: '2.0'
definitions:
  Avatar:
    type: string
    format: byte

When Not to Use It

When the documents must stay readable by tools that only know the older formats.

Related rules

Further reading