fix: handle nullable discriminator fields in JWKS models#514
Merged
BinoyOza-okta merged 4 commits intomasterfrom Mar 19, 2026
Merged
fix: handle nullable discriminator fields in JWKS models#514BinoyOza-okta merged 4 commits intomasterfrom
BinoyOza-okta merged 4 commits intomasterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Handle Nullable Discriminator Fields in JWKS Models
Summary
This PR fixes JWKS (JSON Web Key) deserialization failures when the Okta API returns null values for fields that were incorrectly marked as required in the OpenAPI specification. The fix is template-based to ensure it persists through SDK regeneration.
Problem
Customers reported that
list_applications()would fail with:This occurred when JWKS keys in application credentials contained null values for fields like
use,kid, orkty, which are common in real Okta API responses.Solution
Template Changes (Permanent)
openapi/templates/model_generic.mustachefrom_dict()methodopenapi/api.yamlnullable: true:created,lastUpdated,kty,alg,use,e,nrequiredlistsOther Changes
[nullable]tagsFiles Changed
Templates (Permanent):
openapi/templates/model_generic.mustacheopenapi/api.yamlGenerated Models (Auto-regenerated):
okta/models/Documentation:
docs/OAuth2ClientJsonSigningKeyResponse.mddocs/OAuth2ClientJsonWebKeyRsaResponse.mdBackward Compatibility
✅ 100% backward compatible
Usage Example
Before (Broken):
After (Fixed):