fix: Correct EmailDomain model field deserialization#515
Merged
BinoyOza-okta merged 1 commit intomasterfrom Mar 19, 2026
Merged
fix: Correct EmailDomain model field deserialization#515BinoyOza-okta merged 1 commit intomasterfrom
BinoyOza-okta merged 1 commit intomasterfrom
Conversation
Fix OpenAPI spec indentation causing EmailDomainResponse, EmailDomainResponseWithEmbedded and EmailDomain to drop 5-7 fields during deserialization. API responses now include all fields: id, domain, validationStatus, dnsValidationRecords, etc. Fixed incorrect YAML indentation in allOf composition that prevented OpenAPI generator from processing properties beyond BaseEmailDomain. Fixes: OKTA-1133517
aniket-okta
approved these changes
Mar 19, 2026
There was a problem hiding this comment.
✅ Confirmed fix for OKTA-1133517. The root cause (incorrect allOf YAML indentation) is correctly identified and the regenerated models now deserialize all fields — resp.id, resp.domain, resp.validation_status, and resp.dns_validation_records are all populated as expected. All JIRA repro assertions pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 EmailDomain Model Deserialization - Missing Fields
🐛 Bug Description
The
EmailDomainResponseandEmailDomainmodels were silently dropping 5-7 fields during deserialization, causing 3 of 6 email domain API endpoints to return incomplete data.Affected Endpoints
create_email_domainEmailDomainResponsereplace_email_domainEmailDomainResponseverify_email_domainEmailDomainResponseget_email_domainEmailDomainResponseWithEmbeddedlist_email_domainsList[EmailDomainResponseWithEmbedded]delete_email_domainNone (204)Reproduction
🔍 Root Cause
The OpenAPI specification (
openapi/api.yaml) had incorrect indentation in theallOfcomposition for three schemas:EmailDomain,EmailDomainResponse, andEmailDomainResponseWithEmbedded.❌ Before (Incorrect)
✅ After (Correct)
The OpenAPI generator only processed the schema references, completely ignoring the additional properties due to incorrect YAML structure.
🔧 Solution
1. Fixed OpenAPI Specification
EmailDomainschema (lines 64674-64683)EmailDomainResponseschema (lines 64704-64719)EmailDomainResponseWithEmbeddedschema (lines 64721-64733)allOfcomposition for all three schemas2. Regenerated Models
EmailDomain(Request Model)__propertiesnow includes:displayName,userName,brandId,domain,validationSubdomainfrom_dict()now deserializes all 5 fieldsto_dict()serializes all 5 fieldsEmailDomainResponse(Response Model)__propertiesnow includes:displayName,userName,dnsValidationRecords,domain,id,validationStatus,validationSubdomainfrom_dict()now deserializes all 7 fields with proper type conversionto_dict()properly serializesdnsValidationRecordsarray by callingto_dict()on eachEmailDomainDNSRecordEmailDomainResponseWithEmbedded(Response Model with Embedded Brands)EmailDomainResponse(all 7 fields)_embeddedfield now uses proper typeEmailDomainResponseWithEmbeddedAllOfEmbeddedinstead of genericobjectfrom_dict()correctly deserializes nested_embedded.brandsarrayto_dict()properly serializes nested_embeddedobjectEmailDomainResponseWithEmbeddedAllOfEmbedded(New Model - Generated)_embeddedproperty structurebrandsfield asList[Brand]3. Updated Documentation
✅ Verification
After the fix, all fields are correctly deserialized:
📝 Files Changed
OpenAPI Specification
openapi/api.yaml- Fixed schema indentation forEmailDomain,EmailDomainResponse, andEmailDomainResponseWithEmbeddedGenerated Models
okta/models/email_domain.py- Regenerated with all 5 fieldsokta/models/email_domain_response.py- Regenerated with all 7 fieldsokta/models/email_domain_response_with_embedded.py- Regenerated with proper_embeddedtypeokta/models/email_domain_response_with_embedded_all_of_embedded.py- New model for_embeddedstructureModule Exports
okta/__init__.py- Added export forEmailDomainResponseWithEmbeddedAllOfEmbeddedokta/models/__init__.py- Added export forEmailDomainResponseWithEmbeddedAllOfEmbeddedDocumentation
docs/EmailDomain.md- Updated field listdocs/EmailDomainResponse.md- Updated field listdocs/EmailDomainResponseWithEmbedded.md- Updated with proper_embeddedtypedocs/EmailDomainResponseWithEmbeddedAllOfEmbedded.md- New documentation for nested model🎯 Impact
create_email_domain(),replace_email_domain(), orverify_email_domain()methods🔗 Related Issues
Fixes: OKTA-1133517
📋 Checklist
EmailDomainResponseEmailDomain