/
design.go
43 lines (38 loc) · 975 Bytes
/
design.go
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
/*
Copyright 2021 Adevinta
*/
package design
import (
// Use . imports to enable the DSL
. "github.com/goadesign/goa/design" // nolint
. "github.com/goadesign/goa/design/apidsl" // nolint
)
var APIKey = APIKeySecurity("Bearer", func() {
Header("authorization")
})
var _ = API("Vulcan-API", func() {
Title("Vulcan API")
Description("Public API for Vulcan Vulnerability Scan Engine")
Version("1.1.3")
Scheme("https")
Host("www.vulcan.example.com")
BasePath("/api/v1")
Consumes("application/json")
//Consumes("application/x-www-form-urlencoded", func() {
// Package("github.com/goadesign/goa/encoding/form")
//})
})
var APIErrorMedia = MediaType("error", func() {
Description("Error")
Attributes(func() {
Attribute("code", Integer, "Code")
Attribute("error", String, "Error")
Attribute("type", String, "Type")
Required("code", "error", "type")
})
View("default", func() {
Attribute("code")
Attribute("error")
Attribute("type")
})
})