Skip to content

Commit 33e4748

Browse files
authored
addresses the missing fields in OAuth2ClientJsonSigningKeyResponse (#571)
1 parent 1692823 commit 33e4748

68 files changed

Lines changed: 4650 additions & 2858 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/okta-management-APIs-oasv3-noEnums-inheritance.yaml

Lines changed: 229 additions & 206 deletions
Large diffs are not rendered by default.

.generator/templates/model_oneof.mustache

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
3636
return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup")
3737
}
3838

39+
// Get discriminator value, treating nil/missing as empty string for comparison
40+
discriminatorValue, _ := jsonDict["{{{propertyBaseName}}}"].(string)
41+
3942
{{/-first}}
4043
// check if the discriminator value is '{{{mappingName}}}'
41-
if jsonDict["{{{propertyBaseName}}}"] == "{{{mappingName}}}" {
44+
if discriminatorValue == "{{{mappingName}}}" {
4245
// try to unmarshal JSON data into {{{modelName}}}
4346
err = json.Unmarshal(data, &dst.{{{modelName}}})
4447
if err == nil {
@@ -49,8 +52,20 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error {
4952
}
5053
}
5154

52-
{{/mappedModels}}
55+
{{#-last}}
56+
// If discriminator value is empty/missing, default to the last mapped model (typically the most common type)
57+
if discriminatorValue == "" {
58+
err = json.Unmarshal(data, &dst.{{{modelName}}})
59+
if err == nil {
60+
return nil
61+
}
62+
dst.{{{modelName}}} = nil
63+
}
64+
65+
// No match found or unmarshal failed - return nil to allow partial unmarshalling
5366
return nil
67+
{{/-last}}
68+
{{/mappedModels}}
5469
{{/discriminator}}
5570
{{^discriminator}}
5671
match := 0

okta/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ Class | Method | HTTP request | Description
814814
- [Actions](docs/Actions.md)
815815
- [ActivateFactor200Response](docs/ActivateFactor200Response.md)
816816
- [AddGroupRequest](docs/AddGroupRequest.md)
817+
- [AddJwk201Response](docs/AddJwk201Response.md)
817818
- [AddJwkRequest](docs/AddJwkRequest.md)
818819
- [AdminConsoleSettings](docs/AdminConsoleSettings.md)
819820
- [Agent](docs/Agent.md)
@@ -1122,7 +1123,6 @@ Class | Method | HTTP request | Description
11221123
- [DTCChromeOS](docs/DTCChromeOS.md)
11231124
- [DTCMacOS](docs/DTCMacOS.md)
11241125
- [DTCWindows](docs/DTCWindows.md)
1125-
- [DeactivateOAuth2ClientJsonWebKey200Response](docs/DeactivateOAuth2ClientJsonWebKey200Response.md)
11261126
- [DefaultApp](docs/DefaultApp.md)
11271127
- [DesktopMFAEnforceNumberMatchingChallengeOrgSetting](docs/DesktopMFAEnforceNumberMatchingChallengeOrgSetting.md)
11281128
- [DesktopMFARecoveryPinOrgSetting](docs/DesktopMFARecoveryPinOrgSetting.md)
@@ -1485,7 +1485,6 @@ Class | Method | HTTP request | Description
14851485
- [ListFactors200ResponseInner](docs/ListFactors200ResponseInner.md)
14861486
- [ListFeaturesForApplication200ResponseInner](docs/ListFeaturesForApplication200ResponseInner.md)
14871487
- [ListGroupAssignedRoles200ResponseInner](docs/ListGroupAssignedRoles200ResponseInner.md)
1488-
- [ListJwk200ResponseInner](docs/ListJwk200ResponseInner.md)
14891488
- [ListLogStreams200ResponseInner](docs/ListLogStreams200ResponseInner.md)
14901489
- [ListNetworkZones200ResponseInner](docs/ListNetworkZones200ResponseInner.md)
14911490
- [ListOrgContactTypes200ResponseInner](docs/ListOrgContactTypes200ResponseInner.md)
@@ -1563,6 +1562,7 @@ Class | Method | HTTP request | Description
15631562
- [OAuth2ClientJsonWebKeyResponseBase](docs/OAuth2ClientJsonWebKeyResponseBase.md)
15641563
- [OAuth2ClientJsonWebKeyRsaRequest](docs/OAuth2ClientJsonWebKeyRsaRequest.md)
15651564
- [OAuth2ClientJsonWebKeyRsaResponse](docs/OAuth2ClientJsonWebKeyRsaResponse.md)
1565+
- [OAuth2ClientJsonWebKeySet](docs/OAuth2ClientJsonWebKeySet.md)
15661566
- [OAuth2ClientLinks](docs/OAuth2ClientLinks.md)
15671567
- [OAuth2ClientSecret](docs/OAuth2ClientSecret.md)
15681568
- [OAuth2ClientSecretRequestBody](docs/OAuth2ClientSecretRequestBody.md)

0 commit comments

Comments
 (0)