api: add JSON tags to API models

This commit is contained in:
Jimmy Zelinskie 2016-01-29 15:18:48 -05:00
parent d130d2fab4
commit fa45d516df

View File

@ -14,58 +14,55 @@
package v1 package v1
type ErrorResponse struct {
Error Error
}
type Error struct { type Error struct {
Message string Message string `json:"Layer`
} }
type LayerRequest struct { type LayerEnvelope struct {
Layer Layer Layer Layer `json:"Layer,omitempty"`
Error Error `json:"Error,omitempty"`
} }
type Layer struct { type Layer struct {
Name string Name string `json:"Name,omitempty"`
NamespaceName string NamespaceName string `json:"NamespaceName,omitempty"`
Path string Path string `json:"Path,omitempty"`
ParentName string ParentName string `json:"ParentName,omitempty"`
Format string Format string `json:"Format,omitempty"`
IndexedByVersion int IndexedByVersion int `json:"IndexedByVersion,omitempty"`
Features []Feature Features []Feature `json:"Features,omitempty"`
} }
type Vulnerability struct { type Vulnerability struct {
Name string Name string `json:"Name,omitempty"`
NamespaceName string NamespaceName string `json:"NamespaceName,omitempty"`
Description string Description string `json:"Description,omitempty"`
Severity string Severity string `json:"Severity,omitempty"`
FixedBy string FixedBy string `json:"FixedBy,omitempty"`
FixedIn []Feature FixedIn []Feature `json:"FixedIn,omitempty"`
} }
type Feature struct { type Feature struct {
Name string Name string `json:"Name,omitempty"`
Namespace string Namespace string `json:"Namespace,omitempty"`
Version string Version string `json:"Version,omitempty"`
Vulnerabilities []Vulnerability Vulnerabilities []Vulnerability `json:"Vulnerabilities,omitempty"`
} }
type Notification struct { type Notification struct {
Name string Name string `json:"Name,omitempty"`
Created string Created string `json:"Created,omitempty"`
Notified string Notified string `json:"Notified,omitempty"`
Deleted string Deleted string `json:"Deleted,omitempty"`
Limit int Limit int `json:"Limit,omitempty"`
Page string Page string `json:"Page,omitempty"`
NextPage string NextPage string `json:"NextPage,omitempty"`
Old VulnerabilityWithLayers Old VulnerabilityWithLayers `json:"Old,omitempty"`
New VulnerabilityWithLayers New VulnerabilityWithLayers `json:"New,omitempty"`
Changed []string Changed []string `json:"Changed,omitempty"`
} }
type VulnerabilityWithLayers struct { type VulnerabilityWithLayers struct {
Vulnerability Vulnerability Vulnerability Vulnerability `json:"Vulnerability,omitempty"`
LayersIntroducingVulnerability []string LayersIntroducingVulnerability []string `json:"LayersIntroducingVulnerability,omitempty"`
} }