okta-sdk-golang
okta-sdk-golang copied to clipboard
Bug: Wrong type for `AppUser.Profile` in v4.0.0
Describe the bug?
I believe the Profile
type should be map[string]interface{}
instead map[string]map[string]interface{}
, see of https://github.com/okta/okta-sdk-golang/blob/v4.0.0/okta/model_app_user.go#L46
As a result JSON decoding of AppUser
fails with cannot unmarshal string into Go struct field _AppUser.profile of type map[string]interface {}
What is expected to happen?
Listing application users should succeed
What is the actual behavior?
Listing application users fails
Reproduction Steps?
Use the ListApplicationUsersExecute
API
Additional Information?
Example response from the API can be seen in https://developer.okta.com/docs/reference/api/apps/#response-example-32
Golang Version
go version go1.22.1 darwin/arm64
SDK Version
v4.0.0
OS version
Darwin ****-MBP-2 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
Could be related: https://github.com/OpenAPITools/openapi-generator/issues/15281 https://github.com/OpenAPITools/openapi-generator/issues/15582
OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-716406
@erezrokah Do you have the response that causes the error? for both AppUser.Profile and ApplicationGroupAssignment.Profile
Thanks for the quick response @duytiennguyen-okta, there's an example response in https://github.com/cloudquery/cloudquery/issues/16836#issuecomment-2037535304 for ApplicationGroupAssignment.Profile
but I was able to reproduce for AppUser.Profile
Example response from the API can be seen in https://developer.okta.com/docs/reference/api/apps/#response-example-32
The response I got looks like the one in the REST API docs, copying the one from the docs so the issue has all the information:
[
{
"id": "00ui2sVIFZNCNKFFNBPM",
"externalId": "005o0000000umnEAAQ",
"created": "2014-08-15T18:59:43.000Z",
"lastUpdated": "2014-08-15T18:59:48.000Z",
"scope": "USER",
"status": "PROVISIONED",
"statusChanged": "2014-08-15T18:59:48.000Z",
"passwordChanged": null,
"syncState": "SYNCHRONIZED",
"lastSync": "2014-08-15T18:59:48.000Z",
"credentials": {
"userName": "[email protected]"
},
"profile": {
"secondEmail": null,
"lastName": "McJanky",
"mobilePhone": "415-555-555",
"email": "[email protected]",
"salesforceGroups": [],
"role": "CEO",
"firstName": "Karl",
"profile": "Standard Platform User"
},
"_links": {
"app": {
"href": "https://{yourOktaDomain}/api/v1/apps/0oajiqIRNXPPJBNZMGYL"
},
"user": {
"href": "https://{yourOktaDomain}/api/v1/users/00ui2sVIFZNCNKFFNBPM"
}
}
},
{
"id": "00ujsgVNDRESKKXERBUJ",
"externalId": "005o0000000uqJaAAI",
"created": "2014-08-16T02:35:14.000Z",
"lastUpdated": "2014-08-16T02:56:49.000Z",
"scope": "USER",
"status": "PROVISIONED",
"statusChanged": "2014-08-16T02:56:49.000Z",
"passwordChanged": null,
"syncState": "SYNCHRONIZED",
"lastSync": "2014-08-16T02:56:49.000Z",
"credentials": {
"userName": "[email protected]"
},
"profile": {
"secondEmail": null,
"lastName": "Jackson",
"mobilePhone": null,
"email": "[email protected]",
"salesforceGroups": [
"Employee"
],
"role": "Developer",
"firstName": "Saml",
"profile": "Standard User"
},
"_links": {
"app": {
"href": "https://{yourOktaDomain}/api/v1/apps/0oajiqIRNXPPJBNZMGYL"
},
"user": {
"href": "https://{yourOktaDomain}/api/v1/users/00ujsgVNDRESKKXERBUJ"
}
}
}
]
@erezrokah
- Please censored all the sensitive info.
- I am trying to resolve the issue at the root. Please wait a few days for a updated release
Thanks! No sensitive info the response it is copied from your docs
This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale
label.
Not stale
This issue has been marked stale because there has been no activity within the last 14 days. To keep this issue active, remove the stale
label.
Not stale