-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinfo.go
60 lines (48 loc) · 1.4 KB
/
info.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package oas
type Info struct {
InfoObject
SpecExtensions
}
func (i Info) MarshalJSON() ([]byte, error) {
return flattenMarshalJSON(i.InfoObject, i.SpecExtensions)
}
func (i *Info) UnmarshalJSON(data []byte) error {
return flattenUnmarshalJSON(data, &i.InfoObject, &i.SpecExtensions)
}
type InfoObject struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
TermsOfService string `json:"termsOfService,omitempty"`
*Contact `json:"contact,omitempty"`
*License `json:"license,omitempty"`
Version string `json:"version"`
}
type Contact struct {
ContactObject
SpecExtensions
}
func (i Contact) MarshalJSON() ([]byte, error) {
return flattenMarshalJSON(i.ContactObject, i.SpecExtensions)
}
func (i *Contact) UnmarshalJSON(data []byte) error {
return flattenUnmarshalJSON(data, &i.ContactObject, &i.SpecExtensions)
}
type ContactObject struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
Email string `json:"email,omitempty"`
}
type License struct {
LicenseObject
SpecExtensions
}
func (i License) MarshalJSON() ([]byte, error) {
return flattenMarshalJSON(i.LicenseObject, i.SpecExtensions)
}
func (i *License) UnmarshalJSON(data []byte) error {
return flattenUnmarshalJSON(data, &i.LicenseObject, &i.SpecExtensions)
}
type LicenseObject struct {
Name string `json:"name"`
URL string `json:"url,omitempty"`
}