1
1
{
2
2
"$schema" : " http://json-schema.org/draft-07/schema#" ,
3
3
"type" : " object" ,
4
- "properties" : {
5
- "database" : {
6
- "title" : " Database file" ,
4
+ "definitions" : {
5
+ "namespace" : {
6
+ "title" : " Namespace" ,
7
+ "type" : " string" ,
8
+ "minLength" : 1
9
+ },
10
+ "username" : {
11
+ "title" : " Username" ,
7
12
"type" : " string" ,
8
13
"minLength" : 1
14
+ },
15
+ "askForPassword" : {
16
+ "title" : " Ask for password?" ,
17
+ "type" : " boolean" ,
18
+ "default" : false
19
+ },
20
+ "password" : {
21
+ "title" : " Password" ,
22
+ "type" : " string" ,
23
+ "minLength" : 1
24
+ }
25
+ },
26
+ "properties" : {
27
+ "connectionMethod" : {
28
+ "title" : " Connect using" ,
29
+ "type" : " string" ,
30
+ "minLength" : 1 ,
31
+ "enum" : [" Server and Port" , " Server Name" ],
32
+ "default" : " Server and Port"
33
+ }
34
+ },
35
+ "dependencies" : {
36
+ "connectionMethod" : {
37
+ "oneOf" : [
38
+ {
39
+ "properties" : {
40
+ "connectionMethod" : {
41
+ "enum" : [" Server and Port" ]
42
+ },
43
+ "server" : {
44
+ "title" : " Server Address" ,
45
+ "type" : " string" ,
46
+ "minLength" : 1 ,
47
+ "default" : " localhost"
48
+ },
49
+ "port" : {
50
+ "title" : " WebServer Port" ,
51
+ "minimum" : 1 ,
52
+ "default" : 52773 ,
53
+ "type" : " integer"
54
+ },
55
+ "namespace" : { "$ref" : " #/definitions/namespace" },
56
+ "username" : { "$ref" : " #/definitions/username" },
57
+ "askForPassword" : { "$ref" : " #/definitions/askForPassword" }
58
+ },
59
+ "required" : [" server" , " port" , " namespace" , " username" ]
60
+ },
61
+ {
62
+ "properties" : {
63
+ "connectionMethod" : {
64
+ "enum" : [" Server Name" ]
65
+ },
66
+ "serverName" : {
67
+ "title" : " Server Name" ,
68
+ "type" : " string" ,
69
+ "minLength" : 1
70
+ }
71
+ },
72
+ "required" : [" connectString" ]
73
+ }
74
+ ]
75
+ },
76
+ "askForPassword" : {
77
+ "oneOf" : [
78
+ { "properties" : { "askForPassword" : { "enum" : [true ] } } },
79
+ {
80
+ "properties" : {
81
+ "askForPassword" : { "enum" : [false ] },
82
+ "password" : { "$ref" : " #/definitions/password" }
83
+ },
84
+ "required" : [" password" ]
85
+ }
86
+ ]
9
87
}
10
88
},
11
89
"required" : [
12
- " database "
90
+ " connectionMethod "
13
91
]
14
92
}
0 commit comments