# contact-defined

Source: https://apigenie.pl/docs/linter/openapi/rules/contact-defined

A rule of the OpenAPI linter, which reads OpenAPI 3.0, 3.1 and 3.2 documents. 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.

```yaml
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.

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