Skip to main content

valid-identifier-spdx-license-expression

Overview

This rule belongs to the openapi-v3-syntax-linting ruleset and states that:

The License Object must define a valid SPDX license expression when using the identifier property. The license expression must use only alpha-numeric characters, hyphens, spaces, periods, colons, and plus signs. Characters beyond these must not be used.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageIdentifier SPDX license expression contains invalid characters.
CodeOPENAPI3SYNTAX_L001
TypeLinting
Rule SystemSyntax
Broad CategoryLicenses
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi syntax linting license expression identifier spdx license

Suggested Fixes

  • Make sure that the license identifier does not contain any forbidden characters.
  • Ensure that the license identifier is valid for the following regex pattern: ^[A-Za-z0-9- .+:]+$
  • Use only alpha-numeric characters, hyphens, spaces, periods, colons, and plus signs.
  • Further information about the exact syntax requirements for the SPDX expression can be found in the Appendix IV of SPDX specification document.

For More Information