-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.jl
63 lines (51 loc) · 1022 Bytes
/
example.jl
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
# using Genie, Genie.Router
# using Genie.Renderer, Genie.Renderer.Html, Genie.Renderer.Json
using JSON
using SwaggerMarkdown
@swagger """
/doge:
get:
description: doge
responses:
'200':
description: Returns a doge.
"""
@swagger """
/to:
put:
description: to
responses:
'200':
description: Returns a doge.
"""
@swagger """
/the:
post:
description: the
responses:
'200':
description: Returns a doge.
"""
@swagger """
/moon:
get:
description: moon
responses:
'200':
description: Returns a moon.
"""
function run_example()
info = Dict{String, Any}([
"title" => "Doge to the moon"
"version" => "1.0.5"
])
optional_fields = Dict{String, Any}([
"host" => "localhost"
"basePath" => "/doge"
# "bad" => "bad"
])
openApi = OpenAPI("2.0", info, optional_fields=optional_fields)
spec = build(openApi)
println(JSON.json(spec))
end
run_example()