-
Notifications
You must be signed in to change notification settings - Fork 0
/
realworld-example.yaml
126 lines (101 loc) · 2.61 KB
/
realworld-example.yaml
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: My API app
port: 8080
path: /api
authentication: jwtAuth
databases:
- name: mydb
objects:
- table: users
# authentication
post /users/login:
- varchar username
- varchar password
# registration
post:
- varchar username
- varchar email
- varchar password
# get current user
get* /user:
- varchar username PK
- varchar email
- varchar bio
- varchar image
# update user
put* /user:
- varchar username PK
- varchar email
- varchar bio
- varchar image
# get profile
get /api/profiles/:username:
- varchar username PK
- varchar bio
- varchar image
- boolean following
# follow user
post* /api/profiles/:username/follow:
- varchar username PK
# unfollow user
delete* /api/profiles/:username/unfollow:
- varchar username PK
- table: articles
# list articles
get: /articles?
- varchar slug
- varchar title
- varchar descriptopn
- varchar body
- varchar tagList
- boolean favorited
- int favoritesCount
- object author
# feed articles
get* /articles/feed:
# get article
get /articles/:slug:
- varchar slug PK
- varchar title
- ...
# create article
post*:
- varchar title
- varchar description
- varchar body
- varchar tagList
# update article
put* /articles/:slug:
- varchar title
- varchar description
- varchar body
- varchar tagList
# delete article
delete*:
- varchar slug PK
- table: comments
# add comment
post* /articles/:slug/comments:
- varchar slug PK
- varchar body
# get comments
get /articles/:slug/comments:
- varchar slug PK
- varchar id
- varchar body
- object author
# delete comment
delete /articles/:slug/comments/:id:
- varchar slug PK
- varchar id PK
- table: favorite
# like an article
post* /articles/:slug/favorite:
- varchar username PK
- varchar slug PK
# unlike an article
delete* /articles/:slug/favorite:
- varchar username PK
- varchar slug PK
- table: tags
# get tags
get: