Don't send the empty error value in responses
This commit is contained in:
parent
cf181ea23e
commit
aa2ecace89
1 changed files with 4 additions and 4 deletions
|
@ -25,7 +25,7 @@ type RegisterData struct {
|
||||||
// RegisterResponse describes the response to a register request
|
// RegisterResponse describes the response to a register request
|
||||||
type RegisterResponse struct {
|
type RegisterResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error,omitempty"`
|
||||||
|
|
||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ type SpawnData struct {
|
||||||
// SpawnResponse is the data to respond with on a spawn command
|
// SpawnResponse is the data to respond with on a spawn command
|
||||||
type SpawnResponse struct {
|
type SpawnResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error,omitempty"`
|
||||||
|
|
||||||
// The location of the spawned entity
|
// The location of the spawned entity
|
||||||
Position game.Vector `json:"position"`
|
Position game.Vector `json:"position"`
|
||||||
|
@ -62,7 +62,7 @@ type CommandsData struct {
|
||||||
// CommandsResponse is the response to be sent back
|
// CommandsResponse is the response to be sent back
|
||||||
type CommandsResponse struct {
|
type CommandsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -104,7 +104,7 @@ type RadarData struct {
|
||||||
// RadarResponse describes the response to a /radar call
|
// RadarResponse describes the response to a /radar call
|
||||||
type RadarResponse struct {
|
type RadarResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error,omitempty"`
|
||||||
|
|
||||||
// The set of positions for nearby rovers
|
// The set of positions for nearby rovers
|
||||||
Rovers []game.Vector `json:"rovers"`
|
Rovers []game.Vector `json:"rovers"`
|
||||||
|
|
Loading…
Add table
Reference in a new issue