generated from dwarvesf/nextjs-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.spectral.js
102 lines (100 loc) · 2.59 KB
/
.spectral.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
const ibmCloudValidationRules = require('@ibm-cloud/openapi-ruleset') // Extend default rules from the IBM OpenAPI Ruleset
const {
pathSegmentCaseConvention,
propertyCaseConvention,
enumCaseConvention,
operationIdCaseConvention,
parameterCaseConvention,
} = require('@ibm-cloud/openapi-ruleset/src/functions')
const {
schemas,
paths,
operations,
parameters,
} = require('@ibm-cloud/openapi-ruleset-utilities/src/collections')
module.exports = {
extends: ibmCloudValidationRules,
rules: {
'response-example-provided': 'off',
'operation-description': 'off',
'property-description': 'off',
'schema-description': 'off',
'response-error-response-schema': 'off',
'array-boundary': 'off',
'string-boundary': 'off',
'pagination-style': 'off',
'property-case-convention': {
description: 'Property names must follow camel case convention',
message: '{{error}}',
given: schemas,
resolved: true,
severity: 'error',
then: {
function: propertyCaseConvention,
functionOptions: {
type: 'camel',
},
},
},
'path-segment-case-convention': {
description: 'Path segments must follow camel case convention',
message: '{{error}}',
given: paths,
severity: 'error',
then: {
function: pathSegmentCaseConvention,
functionOptions: {
type: 'camel',
},
},
},
'enum-case-convention': {
description: 'Enum values must follow a specified case convention',
message: '{{error}}',
given: schemas,
severity: 'error',
then: {
function: enumCaseConvention,
functionOptions: {
type: 'camel',
},
},
},
'operation-id-case-convention': {
description: 'Operation ids must follow a specified case convention',
message: '{{error}}',
given: operations,
severity: 'error',
then: {
function: operationIdCaseConvention,
functionOptions: {
type: 'camel',
},
},
},
'parameter-case-convention': {
description: 'Parameter names must follow case conventions',
message: '{{error}}',
given: parameters,
severity: 'error',
resolved: true,
then: {
function: parameterCaseConvention,
functionOptions: {
query: {
type: 'camel',
},
path: {
type: 'camel',
},
header: {
type: 'pascal',
separator: {
char: '-',
},
},
},
},
},
},
}