diff --git a/api/suggest/model.go b/api/suggest/model.go index 8203934..46148c8 100644 --- a/api/suggest/model.go +++ b/api/suggest/model.go @@ -40,15 +40,15 @@ type ( // RequestParams Request struct RequestParams struct { - Type *PartyType `json:"type,omitempty"` // party type for the suggestion (user input) - Query string `json:"query"` // user input for suggestion - Count int `json:"count"` // ligmit for results + Type PartyType `json:"type,omitempty"` // party type for the suggestion (user input) + Query string `json:"query"` // user input for suggestion + Count int `json:"count,omitempty"` // ligmit for results Language string `json:"language,omitempty"` - Locations []*RequestParamsLocation `json:"locations"` - RestrictValue bool `json:"restrict_value"` // don't show restricts (region) on results + Locations []*RequestParamsLocation `json:"locations,omitempty"` + RestrictValue bool `json:"restrict_value,omitempty"` // don't show restricts (region) on results - FromBound *Bound `json:"from_bound"` - ToBound *Bound `json:"to_bound"` + FromBound *Bound `json:"from_bound,omitempty"` + ToBound *Bound `json:"to_bound,omitempty"` } // AddressResponse result slice for address suggestions diff --git a/dadata_test.go b/dadata_test.go index cfbdc7a..886b0dc 100644 --- a/dadata_test.go +++ b/dadata_test.go @@ -105,10 +105,9 @@ func (s *ApiSuggestIntegrationTest) TestPartyWithTypePositive() { api := NewSuggestApi() // positive: there are some legal entities "сбербанк" - legalParty := suggest.PartyTypeLegal res, err := api.Party(context.Background(), &suggest.RequestParams{ Query: "сбербанк", - Type: &legalParty, + Type: suggest.PartyTypeLegal, }) s.NoError(err) @@ -119,10 +118,9 @@ func (s *ApiSuggestIntegrationTest) TestPartyWithTypeNegative() { api := NewSuggestApi() // there are no one individual entrepreneur "сбербанк" - individualParty := suggest.PartyTypeIndividual res, err := api.Party(context.Background(), &suggest.RequestParams{ Query: "сбербанк", - Type: &individualParty, + Type: suggest.PartyTypeIndividual, }) s.NoError(err)