spectral:asyncapi warn on by default

asyncapi-info-license

Info object must have "license" object.

Applies to
license
Selects
$
Function
truthy
Specs
AsyncAPI 2.xAsyncAPI 3.x

Use it

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

extends: spectral:asyncapi
rules:
  asyncapi-info-license: warn   # or off, or another severity

Definition

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

asyncapi-info-license:
  description: Info object must have "license" object.
  recommended: true
  formats:
    - AsyncAPI 2.x
    - AsyncAPI 3.x
  given: $
  then:
    field: info.license
    function: truthy

About this rule

The info object should have a license key.

It can be hard to pick a license, so if you don’t have a lawyer around you can use TLDRLegal and Choose a License to help give you an idea.

How useful this is in court is not entirely known, but having a license is better than not having a license.

Good Example

asyncapi: "2.0.0"
info:
  license:
    name: MIT

Sources