license-url
License object must include "url".
- Applies to
url- Selects
$- Function
truthy- Specs
- OpenAPI 2.0OpenAPI 3.0OpenAPI 3.1OpenAPI 3.2
Use it
This rule ships with OpenLint in spectral:oas. It's off by default, so turn it on by name:
extends: spectral:oas
rules:
license-url: true
Definition
As defined in @openlint/openlint-rulesets. Functions show by name.
license-url:
description: License object must include "url".
recommended: false
given: $
then:
field: info.license.url
function: truthy
About this rule
Mentioning a license is only useful if people know what the license means, so add a link to the full text for those who need it.
Good Example
openapi: "3.0.2"
info:
license:
name: MIT
url: https://www.tldrlegal.com/l/mit