@checkdigit/spectral-config 4.0.0-PR.24-cdae → 4.0.0-PR.28-7b96

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2021-2024 Check Digit, LLC
3
+ Copyright (c) 2021-2026 Check Digit, LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -55,17 +55,10 @@ Install Spectral, by Spotlight https://marketplace.visualstudio.com/items?itemNa
55
55
 
56
56
  ### Rules for Certain Warnings and Errors
57
57
 
58
- #### `no-operationId-allowed`
58
+ `operation-operationId Operation must have "operationId"`
59
59
 
60
- The `no-operationId-allowed` rule enforces that `operationId` field **must not** be in the operations.
60
+ Add an operationId to the operation. Check Digit uses a `noun-noun-verb` naming convention. For example, the correct operationId for a `PUT` to path `/resource/{id}/item/{itemId}/key` is `resource-item-key-put`
61
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.
62
+ ## License
64
63
 
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.
64
+ MIT
package/package.json CHANGED
@@ -1 +1 @@
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"}}
1
+ {"name":"@checkdigit/spectral-config","version":"4.0.0-PR.28-7b96","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":"MIT","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 . --check","prettier:fix":"prettier . --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":"^8.1.1"},"peerDependencies":{"@stoplight/spectral-cli":"6.16.3"},"engines":{"node":">=24.18.0"},"allowScripts":{"@scarf/scarf@1.4.0":false}}
package/ruleset.json CHANGED
@@ -2,14 +2,18 @@
2
2
  "extends": ["spectral:oas"],
3
3
  "rules": {
4
4
  "no-$ref-siblings": "off",
5
+
5
6
  "info-contact": "error",
6
7
  "info-description": "error",
7
8
  "duplicated-entry-in-enum": "error",
8
9
  "operation-success-response": "error",
10
+ "operation-operationId-unique": "error",
9
11
  "operation-tag-defined": "error",
10
12
  "no-eval-in-markdown": "error",
11
13
  "no-script-tags-in-markdown": "error",
12
14
  "operation-description": "error",
15
+ "operation-operationId": "error",
16
+ "operation-operationId-valid-in-url": "error",
13
17
  "operation-tags": "error",
14
18
  "path-declarations-must-exist": "error",
15
19
  "path-keys-no-trailing-slash": "error",
@@ -20,8 +24,10 @@
20
24
  "oas3-operation-security-defined": "error",
21
25
  "oas3-server-trailing-slash": "error",
22
26
  "oas3-unused-component": "error",
27
+
23
28
  "oas2-api-host": "off",
24
29
  "oas2-api-schemes": "off",
30
+
25
31
  "oas2-anyOf": "error",
26
32
  "oas2-discriminator": "error",
27
33
  "oas2-host-trailing-slash": "error",
@@ -31,6 +37,7 @@
31
37
  "oas2-schema": "error",
32
38
  "oas2-unused-definition": "error",
33
39
  "oas2-valid-media-example": "error",
40
+
34
41
  "header-required-property": {
35
42
  "description": "All headers must explicitly define whether they are required.",
36
43
  "message": "Header is missing 'required' property.",
@@ -40,26 +47,6 @@
40
47
  "field": "required",
41
48
  "function": "defined"
42
49
  }
43
- },
44
- "operation-operationId": "off",
45
- "operation-operationId-unique": "off",
46
- "operation-operationId-valid-in-url": "off",
47
- "no-operationId-allowed": {
48
- "description": "operationId is not allowed in our API style.",
49
- "message": "Remove `operationId` from operations.",
50
- "severity": "error",
51
- "given": "$.paths[*][get,put,post,patch,delete,options,head,trace]",
52
- "then": {
53
- "function": "schema",
54
- "functionOptions": {
55
- "schema": {
56
- "type": "object",
57
- "not": {
58
- "required": ["operationId"]
59
- }
60
- }
61
- }
62
- }
63
50
  }
64
51
  }
65
52
  }