fix: drop UnmarshalJSON required-property pre-check on OIDC client settings - #592
Open
exitcode0 wants to merge 3 commits into
Open
fix: drop UnmarshalJSON required-property pre-check on OIDC client settings#592exitcode0 wants to merge 3 commits into
exitcode0 wants to merge 3 commits into
Conversation
The openapi-generator go template emits a generic-map decode + loop in UnmarshalJSON that returns "no value given for required property X" for any field marked `required` in the spec. This pre-check is over-strict on read: the Okta API legitimately returns response bodies that omit fields the spec marks required (e.g. settings.oauthClient.grant_types on preconfigured apps such as okta_atspoke_iam_connector), which makes those apps unreadable through the typed SDK path. Write-side enforcement is unaffected: the typed constructor NewX(...) still requires the spec-required fields, and server-side validation continues to reject empty/missing values on POST/PUT. Fixes okta#591
Reverts the template change and bulk regeneration; instead preserves just `okta/model_open_id_connect_application_settings_client.go` from regeneration via a new `.openapi-generator-ignore` entry, and applies the same one-file fix (drop required-property pre-check + now-unused `fmt` import) directly to that file. This trades a smaller, more focused diff for an ongoing manual sync burden: spec updates that touch `OpenIdConnectApplicationSettingsClient` will need to be re-applied by hand to the preserved file. The ignore comment documents this so the entry can be removed once the upstream generator template is updated to skip required-property validation on the read path.
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.
Fixes #591.
The
gogenerator'sUnmarshalJSONrejects responses missing any spec-required field, but Okta returnsOpenIdConnectApplicationSettingsClientwithoutgrant_typesfor preconfigured apps likeokta_atspoke_iam_connector— making them unreadable through the typed SDK.This drops the pre-check from the affected file and preserves it across regen via
okta/.openapi-generator-ignore. Net diff: 2 files. Write-side safety is unchanged (typed constructor still requiresgrant_types; server still validates on POST/PUT).Trade-off: the ignored file is now hand-maintained. The comment in
.openapi-generator-ignoredocuments the exit criteria (upstreamgotemplate skipping required-property validation on read, likepython-pydanticalready does).Branch history: commits 1+2 (
0d3720fc,7a5861e5) tried the broader template fix (~7500-line regen); commit 3 (76858ccb) reverts that and applies the scoped fix shipped here. Happy to drop commit 3 if you'd prefer the template approach.