-
Notifications
You must be signed in to change notification settings - Fork 31
/
.spectral.yaml
44 lines (44 loc) · 1.64 KB
/
.spectral.yaml
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
extends: spectral:oas
rules:
oas3-unused-component: off
properties-type-object:
description: "type: object must have a properties sibling."
given: "$..[?(@ && @.type == 'object')]"
severity: error
# must not be resolved because $ref-defined objects shall have its type
# defined in the referenced schema, not the referencing field (and $ref
# must be the only property, anyway)
resolved: false
# type field must be defined and contain the value object
then:
- field: "properties"
function: "truthy"
items-type-array:
description: "type: array must have an items sibling."
given: "$..[?(@ && @.type == 'array')]"
severity: error
# must not be resolved because $ref-defined objects shall have its type
# defined in the referenced schema, not the referencing field (and $ref
# must be the only property, anyway)
resolved: false
# type field must be defined and contain the value object
then:
- field: "items"
function: "truthy"
type-object-properties:
description: "Objects with properties must have type: object."
given: "$..[?(@ && @.properties)]"
severity: error
# must not be resolved because $ref-defined objects shall have its type
# defined in the referenced schema, not the referencing field (and $ref
# must be the only property, anyway)
resolved: false
# type field must be defined and contain the value object
then:
- field: "type"
function: defined
- field: "type"
function: enumeration
functionOptions:
values:
- object