Skip to content

Commit 3d7e966

Browse files
author
Enda
authored
fix: remove '.html' suffix from license URL (#14)
1 parent d45536f commit 3d7e966

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

spectral/examples/openapi-valid.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ info:
88
99
license:
1010
name: 'Apache 2.0'
11-
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
11+
url: 'https://www.apache.org/licenses/LICENSE-2.0'
1212
servers:
1313
- url: https://api.openshift.com
1414
description: Main (production) server

spectral/ruleset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ rules:
4141
- http://localhost:8000
4242
- "/"
4343
rhoas-info-license-apache2.0:
44-
severity: warn
44+
severity: error
4545
recommended: true
4646
given: "$"
4747
then:

spectral/src/functions/infoLicenseApache2.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IFunctionPaths, IFunctionResult } from "@stoplight/spectral";
22

3-
export default (targetVal: any, opts: any, paths: IFunctionPaths): IFunctionResult[] => {
3+
export default (targetVal: any, _: any, paths: IFunctionPaths): IFunctionResult[] => {
44
const path = paths.target;
55
if (!targetVal) {
66
return [
@@ -18,8 +18,8 @@ export default (targetVal: any, opts: any, paths: IFunctionPaths): IFunctionResu
1818
path: [...path, 'license']
1919
})
2020
}
21-
const expectUrl = 'https://www.apache.org/licenses/LICENSE-2.0.html'
22-
if (targetVal?.url != expectUrl) {
21+
const expectUrl = 'https://www.apache.org/licenses/LICENSE-2.0';
22+
if (targetVal?.url !== expectUrl) {
2323
results.push({
2424
message: '`url` must be "' + expectUrl + '"',
2525
path: [...path, 'license']

0 commit comments

Comments
 (0)