Conversation
|
Below is the main cause of all the issues and is being worked upon. Root Cause Identified: Missing Discriminator in OpenAPI SpecWe've identified that the underlying issue is not with the missing properties, but with the OpenAPI spec's GroupProfile:
anyOf:
- $ref: '#/components/schemas/OktaUserGroupProfile'
- $ref: '#/components/schemas/OktaActiveDirectoryGroupProfile'Since both profile types now have identical base properties ( The Real Problem:
Proper Fix Needed:
However, the API responses don't currently include this property in the profile object, making proper deserialization impossible. Workaround: We've created an internal ticket to work with the Okta API team to add discriminator support to the Management API spec. |
…to match API response
1971b5d to
18c4630
Compare
Pipeline Failure NoteThe CircleCI pipeline is currently failing due to Chocolatey community repository being down (returning HTTP 500 errors). This is a temporary service outage unrelated to our code changes. Evidence:
The pipeline will resume working once Chocolatey's service is restored. No code changes are needed on our end. |
Summary
Fixes 7 SDK issues caused by OpenAPI spec mismatches with actual Okta API responses.
Issues Fixed
GetUserAsyncreturnsUserGetSingletoninstead ofUserUser, removedUserGetSingletonOriginalGrant.Requestalways null in Token Inline Hooksrequestbut API returnsauthorizationauthorizationGroup.Profile.AdditionalPropertiesmissingadditionalProperties: trueremoved in v10 specOktaUserGroupProfileandOktaActiveDirectoryGroupProfileoneOf/anyOfdeserialization attempted on error responsesListGroups()returns empty for AD-synced groupsGroupProfilesubtypesobjectClassdiscriminator with customGroupJsonConverterListAgentPools()fails with JSON errorlastConnectiondefined asdate-timebut API returns Unix timestampint64ListRolesForClientAsyncreturns nullIOktaCollectionClient<>Reproduction & Verification
How bugs were reproduced:
ListGroups()returned 0 groups,GetUserAsyncreturned wrong typeVerification with fixed SDK:
ListGroups()→ 5 groups returned ✅ListAgentPools()→ 1 pool returned ✅GetUserAsync→ returnsUser✅Changes
OpenAPI Spec (
openapi3/management.yaml)UserGetSingletonschema, changedgetUserresponse toUserOriginalGrant.request→authorizationadditionalProperties: trueto group profile schemasAgent.lastConnectionfromdate-timetoint64listRolesForClientresponse from single object to arrayCustom Code
GroupJsonConverter.cs: Template-based converter usingobjectClassdiscriminatorAbstractOpenAPISchema.cs: SkiponeOf/anyOffor error responsesTests Added
GroupApiTests,AgentPoolsApiTests,RoleAssignmentClientApiTestsTest Results