json-schema-validation

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, 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.

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.

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

Turn it off or change its severity

In apigenie.yaml, off turns the rule off and warning or error sets its severity; a rule with options takes the severity and the options as a pair, [warning, options]. lint.rules has the details.

commands:
  lint:
    rules:
      json-schema-validation: off
Was this helpful?