Skip to content

Commit 52d6257

Browse files
committed
json marshalling fixes
1 parent d14f9b7 commit 52d6257

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

auth/user_mgt.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,12 +841,12 @@ type getAccountInfoResponse struct {
841841
// QueryUserInfoResponse is the response structure for the accounts:query endpoint.
842842
type QueryUserInfoResponse struct {
843843
Users []*UserRecord
844-
Count string
844+
Count int64
845845
}
846846

847847
type queryUsersResponse struct {
848-
Users []*userQueryResponse `json:"usersInfo,omitempty"`
849-
Count string `json:"recordsCount,omitempty"`
848+
Users []*userQueryResponse `json:"userInfo"`
849+
Count int64 `json:"recordsCount,string,omitempty"`
850850
}
851851

852852
// SQLExpression is a query condition used to filter results.
@@ -859,8 +859,8 @@ type SQLExpression struct {
859859
// QueryUsersRequest is the request structure for the accounts:query endpoint.
860860
type QueryUsersRequest struct {
861861
ReturnUserInfo bool `json:"returnUserInfo"`
862-
Limit string `json:"limit,omitempty"`
863-
Offset string `json:"offset,omitempty"`
862+
Limit int64 `json:"limit,string,omitempty"`
863+
Offset int64 `json:"offset,string,omitempty"`
864864
SortBy string `json:"sortBy,omitempty"`
865865
Order string `json:"order,omitempty"`
866866
TenantID string `json:"tenantId,omitempty"`
@@ -1378,6 +1378,8 @@ func (c *baseClient) QueryUsers(ctx context.Context, query *QueryUsersRequest) (
13781378
return nil, err
13791379
}
13801380

1381+
//log.Printf("QueryUsers() with response = %d, %d", parsed.Count, len(parsed.Users))
1382+
13811383
var userRecords []*UserRecord
13821384
for _, user := range parsed.Users {
13831385
userRecord, err := user.makeUserRecord()
@@ -1480,6 +1482,8 @@ func (c *baseClient) post(
14801482
URL: url,
14811483
Body: internal.NewJSONEntity(payload),
14821484
}
1485+
//log.Printf("%+v \n", req.Body)
1486+
//log.Printf("%+v \n", resp)
14831487
return c.httpClient.DoAndUnmarshal(ctx, req, resp)
14841488
}
14851489

internal/http_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ func (c *HTTPClient) DoAndUnmarshal(ctx context.Context, req *Request, v interfa
167167
return nil, err
168168
}
169169

170+
//log.Printf("%+v \n", string(resp.Body))
171+
170172
if v != nil {
171173
if err := json.Unmarshal(resp.Body, v); err != nil {
172174
return nil, fmt.Errorf("error while parsing response: %v", err)

0 commit comments

Comments
 (0)