-
Notifications
You must be signed in to change notification settings - Fork 4
/
conduit-schema.json
75 lines (75 loc) · 2.27 KB
/
conduit-schema.json
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
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"port": {
"type": "integer",
"description": "Port the server runs on; defaults to 3000"
},
"pg": {
"type": "object",
"properties": {
"connStr": {
"type": "string",
"pattern": "^host=[^\\s]+ port=\\d+ (user=[^\\s]+ )?(password=[^\\s]+ )?dbname=[^\\s]+$",
"description": "The connection string"
},
"poolSize": {
"type": "integer",
"minimum": 1,
"description": "How many stripes to divide the pool into. See Data.Pool for details"
},
"maxIdleTime": {
"type": "integer",
"minimum": 10,
"description": "How long connections can remain idle before being disposed of, in seconds"
},
"numStripes": {
"type": "integer",
"minimum": 1,
"description": "How many connections should be held in the connection pool"
},
"truncTables": {
"type": "boolean",
"description": "Whether or not to truncate all tables on application initialization. Only runs if env.type is 'Development'."
}
},
"required": ["connStr", "poolSize", "maxIdleTime", "numStripes", "truncTables"]
},
"jwt": {
"type": "object",
"properties": {
"secret": {
"type": "string",
"description": "Secret to sign JWT w/ using HMAC"
},
"ttl": {
"type": "integer",
"minimum": 0,
"description": "TTL of the JWT in seconds"
}
},
"required": ["secret", "ttl"]
},
"env": {
"type": "object",
"properties": {
"type": {
"enum": ["Development", "Production"],
"description": "Conduit runtime environment. 'Development' has more logging and auto-runs DB migrations"
}
},
"required": ["type"]
}
},
"required": ["pg", "jwt", "env"],
"if": {
"properties": { "env": { "properties": { "type": { "const": "Development" } } } }
},
"then": {
"properties": { "pg": { "properties": { "truncTables": { "type": "boolean" } } } }
},
"else": {
"properties": { "pg": { "properties": { "truncTables": { "enum": [false] } } } }
}
}