@luxass/spectral-ruleset 0.0.4 → 0.0.5

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/dist/ruleset.cjs CHANGED
@@ -261,6 +261,28 @@ var ruleset_default = {
261
261
  },
262
262
  severity: DiagnosticSeverity.Error
263
263
  },
264
+ "luxass/paths-kebab-case": {
265
+ description: "All YAML/JSON paths MUST follow kebab-case",
266
+ severity: DiagnosticSeverity.Warning,
267
+ recommended: true,
268
+ message: "{{property}} is not kebab-case: {{error}}",
269
+ given: "$.paths[*]~",
270
+ then: {
271
+ function: __stoplight_spectral_functions.pattern,
272
+ functionOptions: { match: "^/([a-z0-9]+(-[a-z0-9]+)*)?(/[a-z0-9]+(-[a-z0-9]+)*|/{.+})*$" }
273
+ }
274
+ },
275
+ "luxass/headers-hyphenated-pascal-case": {
276
+ description: "All `HTTP` headers MUST use `Hyphenated-Pascal-Case` notation",
277
+ severity: DiagnosticSeverity.Error,
278
+ recommended: true,
279
+ message: "{{property}} is not hyphenated-pascal-case: {{error}}",
280
+ given: "$..parameters[?(@.in == 'header')].name",
281
+ then: {
282
+ function: __stoplight_spectral_functions.pattern,
283
+ functionOptions: { match: "^[A-Z][a-z0-9]*(-[A-Z][a-z0-9]*)*$" }
284
+ }
285
+ },
264
286
  ...oas2_default,
265
287
  ...oas3_default
266
288
  }
package/dist/ruleset.js CHANGED
@@ -237,6 +237,28 @@ var ruleset_default = {
237
237
  },
238
238
  severity: DiagnosticSeverity.Error
239
239
  },
240
+ "luxass/paths-kebab-case": {
241
+ description: "All YAML/JSON paths MUST follow kebab-case",
242
+ severity: DiagnosticSeverity.Warning,
243
+ recommended: true,
244
+ message: "{{property}} is not kebab-case: {{error}}",
245
+ given: "$.paths[*]~",
246
+ then: {
247
+ function: pattern,
248
+ functionOptions: { match: "^/([a-z0-9]+(-[a-z0-9]+)*)?(/[a-z0-9]+(-[a-z0-9]+)*|/{.+})*$" }
249
+ }
250
+ },
251
+ "luxass/headers-hyphenated-pascal-case": {
252
+ description: "All `HTTP` headers MUST use `Hyphenated-Pascal-Case` notation",
253
+ severity: DiagnosticSeverity.Error,
254
+ recommended: true,
255
+ message: "{{property}} is not hyphenated-pascal-case: {{error}}",
256
+ given: "$..parameters[?(@.in == 'header')].name",
257
+ then: {
258
+ function: pattern,
259
+ functionOptions: { match: "^[A-Z][a-z0-9]*(-[A-Z][a-z0-9]*)*$" }
260
+ }
261
+ },
240
262
  ...oas2_default,
241
263
  ...oas3_default
242
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/spectral-ruleset",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Opinonated ruleset for Spectral",
5
5
  "type": "module",
6
6
  "repository": {