Skip to main content

info-license-strict

Requires an existing license object to identify its license through a nonblank URL or identifier.

AttributeValue
CategoryMetadata
MaturityPlatinum
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
Starter–LenientOff
Recommended–StrictWarning
CompleteError

Intent

A license name alone may be ambiguous. A URL or standardized identifier gives consumers a precise reference.

Flags

  • In Swagger 2.0 and OpenAPI 3.0, an object-valued license without a nonblank string url.
  • In OpenAPI 3.1 and 3.2, an object-valued license with neither nonblank string url nor nonblank string identifier.

Does not flag

A missing or non-object license value, or an existing object with the version-appropriate field. Use info-license to require the license object itself.

See it fail

info:
license:
name: Apache 2.0

Fix it

OpenAPI 3.1 and 3.2 can use an SPDX identifier:

info:
license:
name: Apache 2.0
identifier: Apache-2.0

For Swagger 2.0 and OpenAPI 3.0, provide url instead.

Configure

profiles:
default:
rules:
extends: [recommended]
override:
info-license-strict: error

Nearby: info-license.