Repository navigation
Commit a96cc66
authored
fix: add fields query param to listDevices for response field projection (OKTA-1277564) (#1712)
* fix: add fields query param to listDevices for response field projection (OKTA-1277564)
DeviceIdentityFacadeV1.getDevices supports a fields query param for
response field projection to reduce payload size, but the listDevices
operation in the spec only documented after/limit/search/expand — fields
could never be passed through the SDK.
Adds fields as a new string query parameter on listDevices, documented
with the accepted syntax (top-level fields, profile.<subfield> and
profile:(...) composite syntax) per DeviceProjectionFieldValidator.
Co-Authored-By: Claude Code
* fix: generate backward-compatible overloads when new optional query params are added
Adding a new optional query parameter to an already-shipped operation
(e.g. OKTA-1273483's getDevice expand, OKTA-1273404's listUserGroups
after/limit) changes the arity of the generated method, which silently
breaks any existing caller using the old, shorter signature -- a
compile-time break for real SDK consumers, confirmed via CI as a runtime
MissingMethodException in the Groovy integration tests.
Extends the custom api.mustache template to additionally emit a
required-params-only overload (plus its additionalHeaders variant, and
Paged equivalents) whenever an operation has optional params, delegating
to the full-arity method with null for the omitted optional params. This
restores the previously-shipped signature for any operation whose
required-only shape was the prior public surface, with no impact on
operations that have no optional params.
Note: this does not preserve every historically-shipped arity in general
(e.g. adding a param to an operation that already had other optional
params, like listDevices/fields in OKTA-1277564, still changes that
operation's full-arity signature) -- only the required-only shape is
guaranteed stable.
Co-Authored-By: Claude Code
* fix: scope compatibility overloads to x-preserve-compat ops, fix javadoc
The blanket hasOptionalParams-gated compatibility overloads broke an
unrelated operation (getApplication) with a compile error: an
ambiguous null passed to two overloads of the same arity
(getApplication(String,String) vs the new getApplication(String,Map)).
This happens whenever an operation has exactly one optional param.
Scope the new overloads to only operations explicitly opted in via the
x-preserve-compat vendor extension, and set that extension only on
listUserGroups (the operation this branch's fix touches) so unrelated
operations across the spec are unaffected.
Also fix invalid Javadoc: the compatibility overloads' @PARAM tags
referenced the omitted optional parameters, which don't exist on the
overload's actual signature -- javadoc's doclint correctly rejected
this as "@PARAM name not found", breaking `mvn install`. Replaced with
a prose mention of the omitted params and @PARAM tags for the actual
(required) parameters instead.
Co-Authored-By: Claude Code
* fix: opt listDevices into compatibility overloads
Sets x-preserve-compat on listDevices so the template regenerates a
bare listDevices()/listDevices(headers) convenience overload. Note this
does not preserve the previously-shipped 4-arg
listDevices(after, limit, search, expand) call -- that operation
already had multiple optional params before this ticket's fields
addition, and this fix only restores the required-params-only shape,
not every prior arity. Real callers of the old 4-arg full form will
still need to add null for fields when upgrading.
Co-Authored-By: Claude Code1 parent b0954bf commit a96cc66
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10616 | 10616 | | |
10617 | 10617 | | |
10618 | 10618 | | |
| 10619 | + | |
10619 | 10620 | | |
10620 | 10621 | | |
10621 | 10622 | | |
| |||
10679 | 10680 | | |
10680 | 10681 | | |
10681 | 10682 | | |
| 10683 | + | |
| 10684 | + | |
| 10685 | + | |
| 10686 | + | |
| 10687 | + | |
| 10688 | + | |
| 10689 | + | |
| 10690 | + | |
| 10691 | + | |
| 10692 | + | |
| 10693 | + | |
10682 | 10694 | | |
10683 | 10695 | | |
10684 | 10696 | | |
| |||
0 commit comments