contact-defined

Since 0.0.1 · In the rulesets: Strict at error, All at error

This rule checks that info.contact is present, with a name and a url or an email.

Rule details

A client that hits a problem needs to know whom to ask. The contact object is where the OpenAPI specification puts that information, and a name alone is not enough to reach anyone.

The rule reports Contact object is missing, Contact name is missing or empty, and, when neither is present, Contact email is missing and Contact URL is missing. Turn it off when the point of contact is known to every client and does not change.

Examples

Good. A team name and its Slack channel.

openapi: 3.1.0
info:
  title: Inventory
  version: 12.4.0
  contact:
    name: team-one
    url: https://your-company.slack.com/archives/C0278047U8G
paths: {}

Bad. Nobody to contact.

openapi: 3.1.0
info:
  title: Inventory
  version: 0.2.0
paths: {}

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:
      contact-defined: off
Was this helpful?