Fix the TestAPI_CatalogRegistration test

This commit is contained in:
Matt Keeler 2019-12-06 15:47:41 -05:00
parent 368d5c643f
commit 81b5f9df02
No known key found for this signature in database
GPG key ID: 04DBAE1857E0081B
2 changed files with 18 additions and 1 deletions

View file

@ -322,6 +322,23 @@ func (r *DeregisterRequest) RequestDatacenter() string {
return r.Datacenter
}
func (r *DeregisterRequest) UnmarshalJSON(data []byte) error {
type Alias DeregisterRequest
aux := &struct {
Address string // obsolete field - but we want to explicitly allow it
*Alias
}{
Alias: (*Alias)(r),
}
if err := lib.UnmarshalJSON(data, &aux); err != nil {
return err
}
return nil
}
// QuerySource is used to pass along information about the source node
// in queries so that we can adjust the response based on its network
// coordinates.

View file

@ -68,7 +68,7 @@ type CatalogRegistration struct {
type CatalogDeregistration struct {
Node string
Address string // Obsolete.
Address string `json:",omitempty"` // Obsolete.
Datacenter string
ServiceID string
CheckID string