mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
omitempty these fields since they can be null (#432)
This commit is contained in:
committed by
Travis Reeder
parent
982e8cf642
commit
5dd4112ee4
@@ -2,7 +2,7 @@ package models
|
||||
|
||||
type App struct {
|
||||
Name string `json:"name" db:"name"`
|
||||
Config Config `json:"config" db:"config"`
|
||||
Config Config `json:"config,omitempty" db:"config"`
|
||||
}
|
||||
|
||||
func (a *App) Validate() error {
|
||||
|
||||
@@ -25,12 +25,12 @@ type Route struct {
|
||||
Path string `json:"path" db:"path"`
|
||||
Image string `json:"image" db:"image"`
|
||||
Memory uint64 `json:"memory" db:"memory"`
|
||||
Headers Headers `json:"headers" db:"headers"`
|
||||
Headers Headers `json:"headers,omitempty" db:"headers"`
|
||||
Type string `json:"type" db:"type"`
|
||||
Format string `json:"format" db:"format"`
|
||||
Timeout int32 `json:"timeout" db:"timeout"`
|
||||
IdleTimeout int32 `json:"idle_timeout" db:"idle_timeout"`
|
||||
Config Config `json:"config" db:"config"`
|
||||
Config Config `json:"config,omitempty" db:"config"`
|
||||
}
|
||||
|
||||
// SetDefaults sets zeroed field to defaults.
|
||||
|
||||
Reference in New Issue
Block a user