# schema-format-deprecated

Source: https://api-genie.dev/docs/linter/asyncapi/rules/schema-format-deprecated

A rule of the AsyncAPI linter, which reads AsyncAPI 3 documents; the reader rejects AsyncAPI 2 documents. Since 0.10.0. In the rulesets: Recommended at warning, Strict at warning, All at warning.

This rule reports the formats which the
[OpenAPI format registry](https://spec.openapis.org/registry/format/) 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 |

AsyncAPI schemas are a superset of JSON Schema draft 7, which has `contentEncoding` and `contentMediaType`, so the issues are warnings in AsyncAPI 2.x and 3.x documents. See [Formats](/docs/reference/cli/formats) for every format.

Turn the rule off when the documents must stay readable by tools that only know the older formats.

## Examples

**Good**.

```yaml
asyncapi: 3.0.0
components:
  schemas:
    Avatar:
      type: string
      contentEncoding: base64
```

**Bad**.

```yaml
asyncapi: 3.0.0
components:
  schemas:
    Avatar:
      type: string
      format: byte
```
