UNPKG

2.37 kBJSONView Raw
1{
2 "$id": "http://stoplight.io/schemas/rule.schema.json",
3 "$schema": "http://json-schema.org/draft-07/schema#",
4 "definitions": {
5 "IThen<T,O>": {
6 "properties": {
7 "field": {
8 "type": "string"
9 },
10 "function": {
11 "$ref": "http://stoplight.io/schemas/rule.schema.json#/definitions/T"
12 },
13 "functionOptions": {
14 "$ref": "http://stoplight.io/schemas/rule.schema.json#/definitions/O"
15 }
16 },
17 "required": [
18 "function"
19 ],
20 "type": "object"
21 },
22 "O": {
23 "type": "object"
24 },
25 "T": {
26 "type": "string"
27 }
28 },
29 "properties": {
30 "description": {
31 "type": "string"
32 },
33 "enabled": {
34 "type": "boolean"
35 },
36 "given": {
37 "type": "string"
38 },
39 "severity": {
40 "enum": [
41 0,
42 1,
43 2,
44 3
45 ],
46 "type": "number"
47 },
48 "summary": {
49 "type": "string"
50 },
51 "tags": {
52 "items": {
53 "type": "string"
54 },
55 "type": "array"
56 },
57 "then": {
58 "anyOf": [
59 {
60 "$ref": "http://stoplight.io/schemas/rule.schema.json#/definitions/IThen<T,O>"
61 },
62 {
63 "items": {
64 "$ref": "http://stoplight.io/schemas/rule.schema.json#/definitions/IThen<T,O>"
65 },
66 "type": "array"
67 }
68 ]
69 },
70 "type": {
71 "enum": [
72 "style",
73 "validation"
74 ],
75 "type": "string"
76 },
77 "when": {
78 "properties": {
79 "field": {
80 "type": "string"
81 },
82 "pattern": {
83 "type": "string"
84 }
85 },
86 "required": [
87 "field"
88 ],
89 "type": "object"
90 }
91 },
92 "required": [
93 "given",
94 "then"
95 ],
96 "type": "object"
97}