-
Notifications
You must be signed in to change notification settings - Fork 3
/
apex.axdl
69 lines (62 loc) · 1.52 KB
/
apex.axdl
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
import * from "@apexlang/core"
import * from "@apexlang/rest"
import * from "@apexlang/openapi"
namespace "blogs.v1"
@info(
title: "Simple blog app"
description: "Simple blog application created using NanoBus."
version: "1.0.0"
termsOfService: "https://nanoblog.io/terms/"
contact: {
name: "API Support",
url: "https://nanoblog.io/support",
email: "[email protected]"
},
license: {
name: "Apache 2.0",
url: "https://www.apache.org/licenses/LICENSE-2.0"
}
)
@host("nanoblog.io")
@path("/v1")
"Blog API"
interface Blogs @service @path("/blogs") {
"Post a Tweet."
postBlog(
userId: string,
title: string,
body: string
): Blog @POST @nocode
"Get the Blog feed"
getFeed(
before: datetime? @query
limit: u32 = 100 @query @range(min: 1, max: 1000)
): [Blog] @GET @nocode
"Get a tweet by id."
getBlog(id: string): Blog @GET @path("/{id}") @nocode
"Delete a tweet (only creator has access)"
# To keep this example, simple userId is passed in instead
# of obtained through authentication/authorization.
deleteBlog(id: string, userId: string): Blog @DELETE @path("/{id}") @nocode
}
"Blog entity"
type Blog {
title: string
"The dynamically generated ID."
id: string
"The blog owner ID."
userId: string
"The blog body."
body: string
"The time the blog post was entered."
time: datetime
}
"Blog page"
type BlogPage {
"Before timestamp"
before: datetime?
"Limit result"
limit: u32
"The tweets returned"
items: [Blog]
}