fix: marshal user info address
This commit is contained in:
parent
f6863b95f3
commit
2020731eb6
1 changed files with 11 additions and 6 deletions
|
@ -157,12 +157,17 @@ func (j *jsonUserinfo) setUserinfoAddress(i *UserinfoAddress) {
|
||||||
if i == nil {
|
if i == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
j.JsonUserinfoAddress.Country = i.Country
|
if i.Country == "" && i.Formatted == "" && i.Locality == "" && i.PostalCode == "" && i.Region == "" && i.StreetAddress == "" {
|
||||||
j.JsonUserinfoAddress.Formatted = i.Formatted
|
return
|
||||||
j.JsonUserinfoAddress.Locality = i.Locality
|
}
|
||||||
j.JsonUserinfoAddress.PostalCode = i.PostalCode
|
j.JsonUserinfoAddress = &jsonUserinfoAddress{
|
||||||
j.JsonUserinfoAddress.Region = i.Region
|
Country: i.Country,
|
||||||
j.JsonUserinfoAddress.StreetAddress = i.StreetAddress
|
Formatted: i.Formatted,
|
||||||
|
Locality: i.Locality,
|
||||||
|
PostalCode: i.PostalCode,
|
||||||
|
Region: i.Region,
|
||||||
|
StreetAddress: i.StreetAddress,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserInfoRequest struct {
|
type UserInfoRequest struct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue