Skip to content

Commit a96cc66

Browse files
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 Code
1 parent b0954bf commit a96cc66

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/swagger/api.yaml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10616,6 +10616,7 @@ paths:
1061610616

1061710617
This operation requires [URL encoding](https://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1). For example, `search=profile.displayName eq "Bob"` is encoded as `search=profile.displayName%20eq%20%22Bob%22`.
1061810618
operationId: listDevices
10619+
x-preserve-compat: true
1061910620
parameters:
1062010621
- name: after
1062110622
in: query
@@ -10679,6 +10680,17 @@ paths:
1067910680
UserSummaries:
1068010681
summary: Get the list of associated user summaries
1068110682
value: userSummary
10683+
- name: fields
10684+
in: query
10685+
description: |-
10686+
Specifies a comma-separated list of fields to include in the response, to reduce response size. `id` is always included even if omitted from the request.
10687+
10688+
Top-level fields: `id`, `status`, `created`, `lastUpdated`, `profile`, `_links`.
10689+
10690+
To select a subset of `profile` fields, use either `profile.<subfield>` or `profile:(<subfield1>,<subfield2>,...)`, where `<subfield>` is one of: `displayName`, `platform`, `manufacturer`, `model`, `osVersion`, `serialNumber`, `imei`, `meid`, `udid`, `sid`, `tpmPublicKeyHash`, `registered`, `secureHardwarePresent`, `screenLockType`, `diskEncryptionType`.
10691+
schema:
10692+
type: string
10693+
example: id,status,profile:(displayName,platform)
1068210694
responses:
1068310695
'200':
1068410696
description: OK

0 commit comments

Comments
 (0)