# schema-format-unknown

Source: https://apigenie.pl/techdocs/linter/rules/schema-format-unknown

This rule reports a `format` which is neither in the
[OpenAPI format registry](https://spec.openapis.org/registry/format/) nor
declared in `openapi.custom_formats` of the configuration file.

## Rule Details

Validators, mock servers and code generators ignore formats they don't know, so
a misspelled format (`date_time`, `uuid4`) silently stops being checked. The
`schema-format-unknown` rule finds them. Formats your API defines on purpose
are declared in the
[configuration file](/techdocs/reference/cli-configuration#openapicustom_formats):

```yaml
openapi:
  custom_formats:
    - {name: currency-code, type: string}
```

The rule is off in the `recommended` ruleset, since OpenAPI allows any format,
and a warning in `strict` and `all`. See [Formats](/techdocs/reference/cli-formats)
for the registry's formats.

## Configuration

None.

## Examples

**Good**.

```yaml
components:
  schemas:
    Id:
      type: string
      format: uuid
```

**Bad**.

```yaml
components:
  schemas:
    Id:
      type: string
      format: uuid4
```

## When Not to Use It

When the document uses many formats of its own and listing them in the
configuration file isn't worth it.

## Compatibility

This rule is compatible with all OpenAPI 3.x versions.
