@checkdigit/spectral-config 4.0.0-PR.24-cdae → 4.0.0-PR.24-4dc5
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 +4 -4
- package/package.json +1 -1
- package/ruleset.json +1 -1
package/README.md
CHANGED
|
@@ -60,12 +60,12 @@ Install Spectral, by Spotlight https://marketplace.visualstudio.com/items?itemNa
|
|
|
60
60
|
The `no-operationId-allowed` rule enforces that `operationId` field **must not** be in the operations.
|
|
61
61
|
|
|
62
62
|
**Rationale:**
|
|
63
|
-
The use of `operationId`
|
|
63
|
+
The use of `operationId` requires manual effort and can lead to inconsistencies and maintenance challenges. By disallowing `operationId`, we automatically maintain a consistent naming convention, since our code generation tool chain relies on paths and HTTP methods for operation identification.
|
|
64
64
|
|
|
65
65
|
**Migration Guidance:**
|
|
66
66
|
|
|
67
67
|
- Remove any `operationId` fields.
|
|
68
68
|
- References to the previously generated Koa router Context typings:
|
|
69
|
-
- Update the
|
|
70
|
-
-
|
|
71
|
-
-
|
|
69
|
+
- Update the OpenAPI-related code generation dependencies, and update the npm script `prepare` according to the coding standards to activate Koa router typing support.
|
|
70
|
+
- With Koa router typing support enabled, the typing references should now be able to be removed from the router implementation.
|
|
71
|
+
- Just in case the types need to be used elsewhere, they'll follow the `${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":"4.0.0-PR.24-
|
|
1
|
+
{"name":"@checkdigit/spectral-config","version":"4.0.0-PR.24-4dc5","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[*][*]",
|
|
52
52
|
"then": {
|
|
53
53
|
"function": "schema",
|
|
54
54
|
"functionOptions": {
|