info-license-strict
Requires an existing license object to identify its license through a nonblank URL or identifier.
| Attribute | Value |
|---|---|
| Category | Metadata |
| Maturity | Platinum |
| OpenAPI | Swagger 2.0; OpenAPI 3.0, 3.1, 3.2 |
| Starter–Lenient | Off |
| Recommended–Strict | Warning |
| Complete | Error |
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
urlnor nonblank stringidentifier.
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.