@checkdigit/spectral-config 3.1.0-PR.24-701d → 4.0.0-PR.24-cdae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/package.json +1 -1
- package/ruleset.json +1 -1
package/README.md
CHANGED
|
@@ -54,3 +54,18 @@ Set Included files to the following glob pattern `**/*swagger.yml`.
|
|
|
54
54
|
Install Spectral, by Spotlight https://marketplace.visualstudio.com/items?itemName=stoplight.spectral
|
|
55
55
|
|
|
56
56
|
### Rules for Certain Warnings and Errors
|
|
57
|
+
|
|
58
|
+
#### `no-operationId-allowed`
|
|
59
|
+
|
|
60
|
+
The `no-operationId-allowed` rule enforces that `operationId` field **must not** be in the operations.
|
|
61
|
+
|
|
62
|
+
**Rationale:**
|
|
63
|
+
The use of `operationId` require manual effort and can lead to inconsistencies and maintenance challenges. By disallowing `operationId`, we automatically maintain a consistent naming convention as part of our code generation tool chain rely on paths and HTTP methods for operation identification.
|
|
64
|
+
|
|
65
|
+
**Migration Guidance:**
|
|
66
|
+
|
|
67
|
+
- Remove any `operationId` fields.
|
|
68
|
+
- References to the previously generated Koa router Context typings:
|
|
69
|
+
- Update the openapi related code generation dependencies, and update npm script `prepare` according to the coding standards to activate the koa router typing support.
|
|
70
|
+
- with koa router typing supported enabled, the typing references should now be able to removed from the router implementation.
|
|
71
|
+
- just in case the types need to be used in somewhere else, they'll follow `${Path}${Method}` pattern in PascalCase. For example, `PUT /account/{accountId}:` will translate to AccountPutContext.
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@checkdigit/spectral-config","version":"
|
|
1
|
+
{"name":"@checkdigit/spectral-config","version":"4.0.0-PR.24-cdae","private":false,"description":"Check Digit Spectral Config","homepage":"https://github.com/checkdigit/spectral-config#readme","bugs":{"url":"https://github.com/checkdigit/spectral-config/issues"},"repository":{"type":"git","url":"git+https://github.com/checkdigit/spectral-config.git"},"license":"UNLICENSED","author":"Check Digit, LLC","main":"ruleset.json","files":["ruleset.json"],"scripts":{"ci:compile":"","ci:coverage":"","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"spectral lint test/openapi.yml --ruleset test/.spectral.json","lint":"","lint:fix":"","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:style && npm run ci:lint"},"prettier":"@checkdigit/prettier-config","devDependencies":{"@checkdigit/prettier-config":"^7.1.2"},"peerDependencies":{"@stoplight/spectral-cli":"6.15.0"},"engines":{"node":">=22.18"}}
|
package/ruleset.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"description": "operationId is not allowed in our API style.",
|
|
49
49
|
"message": "Remove `operationId` from operations.",
|
|
50
50
|
"severity": "error",
|
|
51
|
-
"given": "$.paths[*][
|
|
51
|
+
"given": "$.paths[*][get,put,post,patch,delete,options,head,trace]",
|
|
52
52
|
"then": {
|
|
53
53
|
"function": "schema",
|
|
54
54
|
"functionOptions": {
|