Skip to content

Commit ca25d15

Browse files
authored
feat(sage-monorepo): lint OpenAPI descriptions with Redocly (#2839)
1 parent af95e86 commit ca25d15

File tree

14 files changed

+62
-919
lines changed

14 files changed

+62
-919
lines changed

libs/agora/api-description/project.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,11 @@
1414
"lint": {
1515
"executor": "nx:run-commands",
1616
"options": {
17-
"command": "lint-openapi --config tools/ibm-openapi-validator/config.yaml {projectRoot}/build/openapi.yaml"
17+
"command": "redocly lint --config tools/redocly/config.yaml {projectName}"
1818
},
1919
"dependsOn": ["build"]
20-
},
21-
"format": {
22-
"executor": "nx:run-commands",
23-
"options": {
24-
"command": "prettier --write {projectRoot}"
25-
}
26-
},
27-
"format-check": {
28-
"executor": "nx:run-commands",
29-
"options": {
30-
"command": "prettier --check {projectRoot}"
31-
}
3220
}
3321
},
34-
"tags": [],
22+
"tags": ["language:openapi"],
3523
"implicitDependencies": []
3624
}

libs/model-ad/api-description/project.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,11 @@
1414
"lint": {
1515
"executor": "nx:run-commands",
1616
"options": {
17-
"command": "lint-openapi --config tools/ibm-openapi-validator/config.yaml {projectRoot}/build/openapi.yaml"
17+
"command": "redocly lint --config tools/redocly/config.yaml {projectName}"
1818
},
1919
"dependsOn": ["build"]
20-
},
21-
"format": {
22-
"executor": "nx:run-commands",
23-
"options": {
24-
"command": "prettier --write {projectRoot}"
25-
}
26-
},
27-
"format-check": {
28-
"executor": "nx:run-commands",
29-
"options": {
30-
"command": "prettier --check {projectRoot}"
31-
}
3220
}
3321
},
34-
"tags": [],
22+
"tags": ["language:openapi"],
3523
"implicitDependencies": []
3624
}

libs/openchallenges/api-description/project.json

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,11 @@
2929
"lint": {
3030
"executor": "nx:run-commands",
3131
"options": {
32-
"commands": [
33-
"lint-openapi --config tools/ibm-openapi-validator/config.yaml {projectRoot}/build/openapi.yaml",
34-
"lint-openapi --config tools/ibm-openapi-validator/config.yaml {projectRoot}/build/challenge.openapi.yaml",
35-
"lint-openapi --config tools/ibm-openapi-validator/config.yaml {projectRoot}/build/organization.openapi.yaml",
36-
"lint-openapi --config tools/ibm-openapi-validator/config.yaml {projectRoot}/build/image.openapi.yaml"
37-
]
32+
"command": "redocly lint --config tools/redocly/config.yaml {projectName}"
3833
},
3934
"dependsOn": ["build"]
40-
},
41-
"format": {
42-
"executor": "nx:run-commands",
43-
"options": {
44-
"command": "prettier --write {projectRoot}"
45-
}
46-
},
47-
"format-check": {
48-
"executor": "nx:run-commands",
49-
"options": {
50-
"command": "prettier --check {projectRoot}"
51-
}
5235
}
5336
},
54-
"tags": [],
37+
"tags": ["language:openapi"],
5538
"implicitDependencies": []
5639
}

libs/schematic/api-description/openapi-lint-config.yaml

Whitespace-only changes.

libs/schematic/api-description/project.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,18 @@
77
"build": {
88
"executor": "nx:run-commands",
99
"options": {
10-
"commands": ["redocly bundle --output build/openapi.yaml src/openapi.yaml"],
11-
"parallel": true,
10+
"command": "redocly bundle --output build/openapi.yaml src/openapi.yaml",
1211
"cwd": "{projectRoot}"
1312
}
1413
},
1514
"lint": {
1615
"executor": "nx:run-commands",
1716
"options": {
18-
"command": "lint-openapi --config openapi-lint-config.yaml --ruleset spectral.yaml build/openapi.yaml",
19-
"cwd": "{projectRoot}"
17+
"command": "redocly lint --config tools/redocly/config.yaml {projectName}"
2018
},
2119
"dependsOn": ["build"]
22-
},
23-
"format": {
24-
"executor": "nx:run-commands",
25-
"options": {
26-
"command": "prettier --write {projectRoot}"
27-
}
28-
},
29-
"format-check": {
30-
"executor": "nx:run-commands",
31-
"options": {
32-
"command": "prettier --check {projectRoot}"
33-
}
3420
}
3521
},
36-
"tags": [],
22+
"tags": ["language:openapi"],
3723
"implicitDependencies": []
3824
}

libs/schematic/api-description/spectral.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

libs/synapse/api-description/openapi-lint-config.yaml

Whitespace-only changes.

libs/synapse/api-description/project.json

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,28 @@
44
"sourceRoot": "libs/synapse/api-description/src",
55
"projectType": "library",
66
"targets": {
7-
"build": {
7+
"get": {
88
"executor": "nx:run-commands",
99
"options": {
10-
"commands": ["redocly bundle --output build/openapi.yaml src/openapi.yaml"],
11-
"parallel": true,
10+
"command": "curl -fsSL https://rest-docs.synapse.org/rest/openapi/openapispecification.json -o build/openapi.json",
1211
"cwd": "{projectRoot}"
1312
}
1413
},
15-
"lint": {
14+
"build": {
1615
"executor": "nx:run-commands",
1716
"options": {
18-
"command": "lint-openapi --config openapi-lint-config.yaml --ruleset spectral.yaml build/openapi.yaml",
17+
"command": "redocly bundle --output build/openapi.yaml src/openapi.yaml",
1918
"cwd": "{projectRoot}"
20-
},
21-
"dependsOn": ["build"]
22-
},
23-
"format": {
24-
"executor": "nx:run-commands",
25-
"options": {
26-
"command": "prettier --write {projectRoot}"
2719
}
2820
},
29-
"format-check": {
21+
"lint": {
3022
"executor": "nx:run-commands",
3123
"options": {
32-
"command": "prettier --check {projectRoot}"
33-
}
24+
"command": "redocly lint --config tools/redocly/config.yaml {projectName}"
25+
},
26+
"dependsOn": ["build"]
3427
}
3528
},
36-
"tags": [],
29+
"tags": ["language:openapi"],
3730
"implicitDependencies": []
3831
}

libs/synapse/api-description/spectral.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"@openapitools/openapi-generator-cli": "2.5.2",
100100
"@playwright/test": "^1.36.0",
101101
"@prettier/plugin-xml": "2.2.0",
102-
"@redocly/cli": "1.25.2",
102+
"@redocly/cli": "1.25.3",
103103
"@schematics/angular": "18.2.5",
104104
"@storybook/addon-essentials": "8.3.2",
105105
"@storybook/angular": "8.3.2",
@@ -148,7 +148,6 @@
148148
"eslint-plugin-react-hooks": "4.6.0",
149149
"hint": "7.1.3",
150150
"husky": "9.1.5",
151-
"ibm-openapi-validator": "1.22.1",
152151
"jest": "29.7.0",
153152
"jest-environment-jsdom": "29.7.0",
154153
"jest-preset-angular": "14.1.1",

0 commit comments

Comments
 (0)