Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OKTA-803484: Fix deserialization issue with BrandsApi::listBrandDomains() response #1566

Conversation

arvindkrishnakumar-okta
Copy link
Contributor

@arvindkrishnakumar-okta arvindkrishnakumar-okta commented Oct 4, 2024

Issue(s)

OKTA-803484

Description

While deserializing CustomizationApi/BrandsApi - listBrandDomains(..), an error is seen while ObjectMapper tries to convert an Object into ArrayList.

The issue here is for listBrandDomains() API, Okta backend returns a root element i.e. domains (which is not the case with any other APIs that return a list of objects in response). We need to strip this root element before passing the response to ObjectMapper for deserialization into list of POJOs.

Here is a sample response:

{
   "domains":[
      {
         "id":"default",
         "domain":"example.com",
         "certificateSourceType":"OKTA_MANAGED",
         "validationStatus":"COMPLETED",
         "brandId":"bnd6bdxxxxxxUNQLq1d7",
         "_links":{
            "self":{
               "href":"https://example.com/api/v1/domains/default",
               "hints":{
                  "allow":[
                     "GET"
                  ]
               }
            },
            "brand":{
               "href":"https://example.com/api/v1/brands/bnd6bdwarow6UNQLq1d7",
               "hints":{
                  "allow":[
                     "GET",
                     "PUT",
                     "DELETE"
                  ]
               }
            }
         }
      }
   ]
}

Category

  • Bugfix
  • Enhancement
  • New Feature
  • Library Upgrade
  • Configuration Change
  • Versioning Change
  • Unit or Integration Test(s)
  • Documentation

Signoff

  • I have submitted a CLA for this PR
  • Each commit message explains what the commit does
  • I have updated documentation to explain what my PR does
  • My code is covered by tests if required
  • I did not edit any automatically generated files

@arvindkrishnakumar-okta arvindkrishnakumar-okta changed the title OKTA-803484: Fix deserialization issue with BrandsApi::listBrandDomains() response OKTA-803484: Fix deserialization issue with BrandsApi::listBrandDomains() response Oct 4, 2024
@arvindkrishnakumar-okta arvindkrishnakumar-okta merged commit 882a1fe into master Oct 4, 2024
7 checks passed
@arvindkrishnakumar-okta arvindkrishnakumar-okta deleted the ak_okta_803484_brandsapi_listbranddomains_response_issue branch October 4, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants