Skip to content

Commit 4074fb4

Browse files
committed
add schema folder
1 parent 30e1540 commit 4074fb4

File tree

6 files changed

+189
-1
lines changed

6 files changed

+189
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Build results
22
/target
3-
/schema
43

54
# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327)
65
.cargo-ok

schema/counter.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"contract_name": "counter",
3+
"contract_version": "0.1.0",
4+
"idl_version": "1.0.0",
5+
"instantiate": {
6+
"$schema": "http://json-schema.org/draft-07/schema#",
7+
"title": "InstantiateMsg",
8+
"type": "object",
9+
"required": [
10+
"count"
11+
],
12+
"properties": {
13+
"count": {
14+
"type": "integer",
15+
"format": "int32"
16+
}
17+
},
18+
"additionalProperties": false
19+
},
20+
"execute": {
21+
"$schema": "http://json-schema.org/draft-07/schema#",
22+
"title": "ExecuteMsg",
23+
"oneOf": [
24+
{
25+
"type": "object",
26+
"required": [
27+
"increment"
28+
],
29+
"properties": {
30+
"increment": {
31+
"type": "object",
32+
"additionalProperties": false
33+
}
34+
},
35+
"additionalProperties": false
36+
},
37+
{
38+
"type": "object",
39+
"required": [
40+
"reset"
41+
],
42+
"properties": {
43+
"reset": {
44+
"type": "object",
45+
"required": [
46+
"count"
47+
],
48+
"properties": {
49+
"count": {
50+
"type": "integer",
51+
"format": "int32"
52+
}
53+
},
54+
"additionalProperties": false
55+
}
56+
},
57+
"additionalProperties": false
58+
}
59+
]
60+
},
61+
"query": {
62+
"$schema": "http://json-schema.org/draft-07/schema#",
63+
"title": "QueryMsg",
64+
"oneOf": [
65+
{
66+
"type": "object",
67+
"required": [
68+
"get_count"
69+
],
70+
"properties": {
71+
"get_count": {
72+
"type": "object",
73+
"additionalProperties": false
74+
}
75+
},
76+
"additionalProperties": false
77+
}
78+
]
79+
},
80+
"migrate": null,
81+
"sudo": null,
82+
"responses": {
83+
"get_count": {
84+
"$schema": "http://json-schema.org/draft-07/schema#",
85+
"title": "GetCountResponse",
86+
"type": "object",
87+
"required": [
88+
"count"
89+
],
90+
"properties": {
91+
"count": {
92+
"type": "integer",
93+
"format": "int32"
94+
}
95+
},
96+
"additionalProperties": false
97+
}
98+
}
99+
}

schema/raw/execute.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "ExecuteMsg",
4+
"oneOf": [
5+
{
6+
"type": "object",
7+
"required": [
8+
"increment"
9+
],
10+
"properties": {
11+
"increment": {
12+
"type": "object",
13+
"additionalProperties": false
14+
}
15+
},
16+
"additionalProperties": false
17+
},
18+
{
19+
"type": "object",
20+
"required": [
21+
"reset"
22+
],
23+
"properties": {
24+
"reset": {
25+
"type": "object",
26+
"required": [
27+
"count"
28+
],
29+
"properties": {
30+
"count": {
31+
"type": "integer",
32+
"format": "int32"
33+
}
34+
},
35+
"additionalProperties": false
36+
}
37+
},
38+
"additionalProperties": false
39+
}
40+
]
41+
}

schema/raw/instantiate.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "InstantiateMsg",
4+
"type": "object",
5+
"required": [
6+
"count"
7+
],
8+
"properties": {
9+
"count": {
10+
"type": "integer",
11+
"format": "int32"
12+
}
13+
},
14+
"additionalProperties": false
15+
}

schema/raw/query.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "QueryMsg",
4+
"oneOf": [
5+
{
6+
"type": "object",
7+
"required": [
8+
"get_count"
9+
],
10+
"properties": {
11+
"get_count": {
12+
"type": "object",
13+
"additionalProperties": false
14+
}
15+
},
16+
"additionalProperties": false
17+
}
18+
]
19+
}

schema/raw/response_to_get_count.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"title": "GetCountResponse",
4+
"type": "object",
5+
"required": [
6+
"count"
7+
],
8+
"properties": {
9+
"count": {
10+
"type": "integer",
11+
"format": "int32"
12+
}
13+
},
14+
"additionalProperties": false
15+
}

0 commit comments

Comments
 (0)