Fix the TestAPI_CatalogRegistration test

This commit is contained in:
Matt Keeler 2019-12-06 15:47:41 -05:00
parent 9ff69194a2
commit 2343413bf0
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