# json-schema-validation

Source: https://apigenie.pl/docs/linter/openapi/rules/json-schema-validation

A rule of the OpenAPI linter, which reads OpenAPI 3.0, 3.1 and 3.2 documents. Since 0.5.0. In no ruleset.

This rule validates the document against API Genie's own meta-schema of OpenAPI 3.0 or 3.1 and
reports every violation the validator finds.

## Rule details

The rule predates
[openapi-json-schema-validation](/docs/linter/openapi/rules/openapi-json-schema-validation),
which validates the document against the schemas published by the OpenAPI Initiative for
OpenAPI 3.0, 3.1 and 3.2 and is in the `recommended` ruleset. This rule is in no ruleset and
reports the issues of its validator as they come, without positions of its own; turn it on when
you want a second opinion on a 3.0 or 3.1 document.

## Examples

**Good**. A valid document.

```yaml
openapi: 3.0.3
info:
  title: Sample API
  version: 1.0.0
paths: {}
```

**Bad**. `paths` is misspelled, so the document does not match the meta-schema.

```yaml
openapi: 3.0.3
info:
  title: Sample API
  version: 1.0.0
path: {}
```
