spectral:oas warn on by default

info-contact

Info object must have "contact" object.

Applies to
contact
Selects
$
Function
truthy
Specs
OpenAPI 2.0OpenAPI 3.0OpenAPI 3.1OpenAPI 3.2

Use it

This rule ships with OpenLint in spectral:oas. Extending the ruleset turns it on:

extends: spectral:oas
rules:
  info-contact: warn   # or off, or another severity

Definition

As defined in @openlint/openlint-rulesets. Functions show by name.

info-contact:
  description: Info object must have "contact" object.
  recommended: true
  given: $
  then:
    field: info.contact
    function: truthy

About this rule

Info object should contain contact object.

Hopefully, your API description document is so good that nobody ever needs to contact you with questions, but that is rarely the case. The contact object has a few different options for contact details.

Good Example

openapi: "3.0.2"
info:
  title: Awesome API
  version: "1.0"
  contact:
    name: A-Team
    email: a-team@goarmy.com

Sources