okta / okta-sdk-golang

A Golang SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
https://github.com/okta/okta-sdk-golang
Other
171 stars 142 forks source link

ListLogEvents fails to unmarshal the response due to the LogTransaction field #464

Closed ArikWiz closed 1 month ago

ArikWiz commented 1 month ago

Describe the bug?

When calling ListLogEvents of the SystemLogAPI, an error is returned: cannot unmarshal string into Go struct field _LogEvent.transaction of type map[string]interface {}

See: https://developer.okta.com/docs/reference/api/system-log/#transaction-object

What is expected to happen?

The response should be unmarshalled correctly, returning an LogEvent object

What is the actual behavior?

An error is returned

Reproduction Steps?

Call ListLogEvents(), from the okta.SystemLogAPI client

Additional Information?

in okta/model_log_transaction.go, the Detail field in LogTransaction, is defined as: map[string]map[string]interface{} I believe the correct field type is: map[string]string

this is very similar to a previous bug i reported: https://github.com/okta/okta-sdk-golang/issues/462

Also, the DetailEntry field of LogActor, in okta/model_log_actor.go appears to contain the same problem: DetailEntry map[string]map[string]interface{} Should probably be fixed as well

Golang Version

go version go1.22.1 darwin/arm64

SDK Version

v4.1.1

OS version

No response

duytiennguyen-okta commented 1 month ago

Close with #466