Skip to content

Commit df39170

Browse files
wip
1 parent b4681e9 commit df39170

File tree

11 files changed

+133
-17
lines changed

11 files changed

+133
-17
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# IN PROGRESS
2+
3+
This repository is a part of [__Contracto__](https://github.com/kv109/contracto) project.
4+
5+
It contains [definition](https://github.com/kv109/contracto_sample-contract/wiki/Contract-definition) of contract, documentation of contract [format](https://github.com/kv109/contracto_sample-contract/wiki/Contract-format) and contract [example](https://github.com/kv109/contracto_sample-contract/blob/master/contract.con.json).

contract.cdc.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

contracto/config.ru

Lines changed: 0 additions & 6 deletions
This file was deleted.

contracto/server.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

posts.con.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[
2+
{
3+
"request": {
4+
"http_method": "get",
5+
"path": "/users/:id/posts"
6+
},
7+
"responses": [
8+
{
9+
"request": {
10+
"headers": {
11+
"Content-Type": "application/json"
12+
},
13+
"params": {
14+
"id": 1
15+
}
16+
},
17+
"response": {
18+
"body_path": "/users/1/posts.json"
19+
}
20+
},
21+
{
22+
"request": {
23+
"headers": {
24+
"Content-Type": "application/json"
25+
},
26+
"params": {
27+
"id": 2
28+
}
29+
},
30+
"response": {
31+
"body_path": "/users/2/posts.json"
32+
}
33+
}
34+
]
35+
}
36+
]

users.con.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[
2+
{
3+
"request": {
4+
"http_method": "get",
5+
"path": "/users"
6+
},
7+
"responses": [
8+
{
9+
"request": {
10+
"headers": {
11+
"Content-Type": "application/json"
12+
}
13+
},
14+
"response": {
15+
"body_path": "/users.json"
16+
}
17+
}
18+
]
19+
},
20+
{
21+
"request": {
22+
"http_method": "get",
23+
"path": "/users/:id"
24+
},
25+
"responses": [
26+
{
27+
"request": {
28+
"headers": {
29+
"Content-Type": "application/json"
30+
},
31+
"params": {
32+
"id": 1
33+
}
34+
},
35+
"response": {
36+
"body_path": "/users/1.json"
37+
}
38+
},
39+
{
40+
"request": {
41+
"headers": {
42+
"Content-Type": "application/json"
43+
},
44+
"params": {
45+
"id": 2
46+
}
47+
},
48+
"response": {
49+
"body_path": "/users/2.json"
50+
}
51+
}
52+
]
53+
}
54+
]

users.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"first_name": "Albert",
4+
"last_name": "Einstein",
5+
"age": 30
6+
},
7+
{
8+
"first_name": "Kurt",
9+
"last_name": "Godel",
10+
"age": 35
11+
}
12+
]

users/1.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": :id,
3+
"first_name": "Albert",
4+
"last_name": "Einstein",
5+
"age": 30
6+
}

users/1/posts.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"id": 1,
4+
"title": "When I got home",
5+
"content": "I killed my wife"
6+
}
7+
]

users/2.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": :id,
3+
"first_name": "Kurt",
4+
"last_name": "Godel",
5+
"age": 35
6+
}

users/2/posts.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"id": 5,
4+
"title": "I had fun once",
5+
"content": "It was awful"
6+
}
7+
]

0 commit comments

Comments
 (0)