fix: make grant_types optional in OpenIdConnectApplicationSettingsClient#575
Open
alexander-vyh wants to merge 1 commit intookta:masterfrom
Open
fix: make grant_types optional in OpenIdConnectApplicationSettingsClient#575alexander-vyh wants to merge 1 commit intookta:masterfrom
alexander-vyh wants to merge 1 commit intookta:masterfrom
Conversation
11 tasks
Rebased onto master after v6.1.0 openapi spec regeneration.
The Okta API does not require grant_types when creating an OIDC
application client — it defaults to [authorization_code]. The
generated Go SDK incorrectly marks grant_types as a required property,
which forces callers to supply an empty array just to satisfy the
constructor signature and triggers a JSON unmarshal error on responses
where grant_types isn't present.
This change:
- Removes the required: [grant_types] entry from the two source
OpenAPI spec files (.generator/*.yaml and okta/api/openapi.yaml)
- Regenerates the affected Go model:
- GrantTypes json tag gains omitempty
- NewOpenIdConnectApplicationSettingsClient no longer takes a
grantTypes parameter
- GetGrantTypes/GetGrantTypesOk handle nil GrantTypes
- UnmarshalJSON drops the requiredProperties check for grant_types
- ToMap skips grant_types when nil
f6b11e3 to
55dd075
Compare
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.
obvious fix
Summary
The Okta API does not always return
grant_typesin OIDC app responses,but the OpenAPI spec marks it as required. This causes
UnmarshalJSONtofail with:
Applies the same fix pattern introduced in #559 to a field that PR did
not cover. Changes:
grant_typesfrom therequiredlist in both spec YAML filesmake generate(working tree clean after)Fixes #N/A
Type of PR
Test Information
Go Version: go1.25.6 darwin/arm64
OS Version: macOS 15.7.2 (darwin/arm64)
OpenAPI Spec Version: openapi-generator-cli 7.15.0
Signoff
(Claiming the obvious fix exception — this change removes an incorrectly
required field with no new functionality added, following the same pattern
already established in fix: Remove required fields that are optional in API responses #559. If this does not qualify, please let me know
and I will sign the CLA promptly.)
make fmton my code