-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query param serialization for requests with enums #140
Conversation
@@ -103,24 +97,30 @@ private static String getFieldName(Field f) { | |||
} | |||
} | |||
|
|||
private static Map<String, Object> flattenObject(Object o) { | |||
private static Map<String, Object> flattenObject(Object o, Boolean onlyAnnotatedFields) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the test is dependent on another PR, should we add a unit tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have... but the other PR should be merged in the next day or two, so I think we can deal with that.
* Added support for propagating Request Headers through API Client ([#135](#135)). * Added support for InputStream for streaming request and response bodies ([#138](#138)). * Fixed query param serialization for requests with enums ([#140](#140)). Breaking API Changes: * Changed `list()` method for `accountClient.storageCredentials()` service to return `com.databricks.sdk.service.catalog.StorageCredentialInfoList` class. * Removed `workspaceClient.securableTags()` service and all related classes. * Removed `workspaceClient.subentityTags()` service and all related classes. * Renamed `provisioningState` field for `com.databricks.sdk.service.catalog.ConnectionInfo` to `provisioningInfo`. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.CreateInstancePool`. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.EditInstancePool`. * Removed `com.databricks.sdk.service.compute.FleetLaunchTemplateOverride` class. * Removed `com.databricks.sdk.service.compute.FleetOnDemandOption` class. * Removed `com.databricks.sdk.service.compute.FleetOnDemandOptionAllocationStrategy` class. * Removed `com.databricks.sdk.service.compute.FleetSpotOption` class. * Removed `com.databricks.sdk.service.compute.FleetSpotOptionAllocationStrategy` class. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.GetInstancePool`. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.InstancePoolAndStats`. * Removed `com.databricks.sdk.service.compute.InstancePoolFleetAttributes` class. * Changed `getByName()` method for `workspaceClient.experiments()` service to return `com.databricks.sdk.service.ml.GetExperimentResponse` class. * Changed `getExperiment()` method for `workspaceClient.experiments()` service to return `com.databricks.sdk.service.ml.GetExperimentResponse` class. * Renamed `com.databricks.sdk.service.ml.GetExperimentByNameResponse` class to `com.databricks.sdk.service.ml.GetExperimentResponse`. API Changes: * Added `workspaceClient.modelVersions()` service. * Added `workspaceClient.registeredModels()` service. * Added `browseOnly` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `fullName` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `provisioningInfo` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `securableKind` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `securableType` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `options` field for `com.databricks.sdk.service.catalog.CreateCatalog`. * Added `options` field for `com.databricks.sdk.service.catalog.UpdateCatalog`. * Added `com.databricks.sdk.service.catalog.CatalogInfoSecurableKind` class. * Added `com.databricks.sdk.service.catalog.CreateRegisteredModelRequest` class. * Added `com.databricks.sdk.service.catalog.DeleteAliasRequest` class. * Added `com.databricks.sdk.service.catalog.DeleteModelVersionRequest` class. * Added `com.databricks.sdk.service.catalog.DeleteRegisteredModelRequest` class. * Added `com.databricks.sdk.service.catalog.GetByAliasRequest` class. * Added `com.databricks.sdk.service.catalog.GetModelVersionRequest` class. * Added `com.databricks.sdk.service.catalog.GetRegisteredModelRequest` class. * Added `com.databricks.sdk.service.catalog.ListModelVersionsRequest` class. * Added `com.databricks.sdk.service.catalog.ListModelVersionsResponse` class. * Added `com.databricks.sdk.service.catalog.ListRegisteredModelsRequest` class. * Added `com.databricks.sdk.service.catalog.ListRegisteredModelsResponse` class. * Added `com.databricks.sdk.service.catalog.ModelVersionInfo` class. * Added `com.databricks.sdk.service.catalog.ModelVersionInfoStatus` class. * Added `com.databricks.sdk.service.catalog.ProvisioningInfo` class. * Added `com.databricks.sdk.service.catalog.ProvisioningInfoState` class. * Added `com.databricks.sdk.service.catalog.RegisteredModelAlias` class. * Added `com.databricks.sdk.service.catalog.RegisteredModelInfo` class. * Added `com.databricks.sdk.service.catalog.SetRegisteredModelAliasRequest` class. * Added `com.databricks.sdk.service.catalog.UpdateModelVersionRequest` class. * Added `com.databricks.sdk.service.catalog.UpdateRegisteredModelRequest` class. * Added `volumes` field for `com.databricks.sdk.service.compute.InitScriptInfo`. * Added `com.databricks.sdk.service.compute.VolumesStorageInfo` class. * Added `workspaceClient.files()` service. * Added `com.databricks.sdk.service.files.DeleteFileRequest` class. * Added `com.databricks.sdk.service.files.DownloadRequest` class. * Added `com.databricks.sdk.service.files.DownloadResponse` class. * Added `com.databricks.sdk.service.files.UploadRequest` class. * Added `customTags` field for `com.databricks.sdk.service.provisioning.CreateWorkspaceRequest`. * Added `customTags` field for `com.databricks.sdk.service.provisioning.UpdateWorkspaceRequest`. * Added `customTags` field for `com.databricks.sdk.service.provisioning.Workspace`. * Added `com.databricks.sdk.service.provisioning.CustomTags` class. * Added `parameters` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest`. * Added `rowLimit` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest`. * Added `com.databricks.sdk.service.sql.StatementParameterListItem` class. OpenAPI SHA: 5d0ccbb790d341eae8e85321a685a9e9e2d5bf24, Date: 2023-08-29
* Added support for propagating Request Headers through API Client ([#135](#135)). * Added support for InputStream for streaming request and response bodies ([#138](#138)). * Fixed query param serialization for requests with enums ([#140](#140)). Breaking API Changes: * Changed `list()` method for `accountClient.storageCredentials()` service to return `com.databricks.sdk.service.catalog.StorageCredentialInfoList` class. * Removed `workspaceClient.securableTags()` service and all related classes. * Removed `workspaceClient.subentityTags()` service and all related classes. * Renamed `provisioningState` field for `com.databricks.sdk.service.catalog.ConnectionInfo` to `provisioningInfo`. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.CreateInstancePool`. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.EditInstancePool`. * Removed `com.databricks.sdk.service.compute.FleetLaunchTemplateOverride` class. * Removed `com.databricks.sdk.service.compute.FleetOnDemandOption` class. * Removed `com.databricks.sdk.service.compute.FleetOnDemandOptionAllocationStrategy` class. * Removed `com.databricks.sdk.service.compute.FleetSpotOption` class. * Removed `com.databricks.sdk.service.compute.FleetSpotOptionAllocationStrategy` class. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.GetInstancePool`. * Removed `instancePoolFleetAttributes` field for `com.databricks.sdk.service.compute.InstancePoolAndStats`. * Removed `com.databricks.sdk.service.compute.InstancePoolFleetAttributes` class. * Changed `getByName()` method for `workspaceClient.experiments()` service to return `com.databricks.sdk.service.ml.GetExperimentResponse` class. * Changed `getExperiment()` method for `workspaceClient.experiments()` service to return `com.databricks.sdk.service.ml.GetExperimentResponse` class. * Renamed `com.databricks.sdk.service.ml.GetExperimentByNameResponse` class to `com.databricks.sdk.service.ml.GetExperimentResponse`. API Changes: * Added `workspaceClient.modelVersions()` service. * Added `workspaceClient.registeredModels()` service. * Added `browseOnly` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `fullName` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `provisioningInfo` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `securableKind` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `securableType` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Added `options` field for `com.databricks.sdk.service.catalog.CreateCatalog`. * Added `options` field for `com.databricks.sdk.service.catalog.UpdateCatalog`. * Added `com.databricks.sdk.service.catalog.CatalogInfoSecurableKind` class. * Added `com.databricks.sdk.service.catalog.CreateRegisteredModelRequest` class. * Added `com.databricks.sdk.service.catalog.DeleteAliasRequest` class. * Added `com.databricks.sdk.service.catalog.DeleteModelVersionRequest` class. * Added `com.databricks.sdk.service.catalog.DeleteRegisteredModelRequest` class. * Added `com.databricks.sdk.service.catalog.GetByAliasRequest` class. * Added `com.databricks.sdk.service.catalog.GetModelVersionRequest` class. * Added `com.databricks.sdk.service.catalog.GetRegisteredModelRequest` class. * Added `com.databricks.sdk.service.catalog.ListModelVersionsRequest` class. * Added `com.databricks.sdk.service.catalog.ListModelVersionsResponse` class. * Added `com.databricks.sdk.service.catalog.ListRegisteredModelsRequest` class. * Added `com.databricks.sdk.service.catalog.ListRegisteredModelsResponse` class. * Added `com.databricks.sdk.service.catalog.ModelVersionInfo` class. * Added `com.databricks.sdk.service.catalog.ModelVersionInfoStatus` class. * Added `com.databricks.sdk.service.catalog.ProvisioningInfo` class. * Added `com.databricks.sdk.service.catalog.ProvisioningInfoState` class. * Added `com.databricks.sdk.service.catalog.RegisteredModelAlias` class. * Added `com.databricks.sdk.service.catalog.RegisteredModelInfo` class. * Added `com.databricks.sdk.service.catalog.SetRegisteredModelAliasRequest` class. * Added `com.databricks.sdk.service.catalog.UpdateModelVersionRequest` class. * Added `com.databricks.sdk.service.catalog.UpdateRegisteredModelRequest` class. * Added `volumes` field for `com.databricks.sdk.service.compute.InitScriptInfo`. * Added `com.databricks.sdk.service.compute.VolumesStorageInfo` class. * Added `workspaceClient.files()` service. * Added `com.databricks.sdk.service.files.DeleteFileRequest` class. * Added `com.databricks.sdk.service.files.DownloadRequest` class. * Added `com.databricks.sdk.service.files.DownloadResponse` class. * Added `com.databricks.sdk.service.files.UploadRequest` class. * Added `customTags` field for `com.databricks.sdk.service.provisioning.CreateWorkspaceRequest`. * Added `customTags` field for `com.databricks.sdk.service.provisioning.UpdateWorkspaceRequest`. * Added `customTags` field for `com.databricks.sdk.service.provisioning.Workspace`. * Added `com.databricks.sdk.service.provisioning.CustomTags` class. * Added `parameters` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest`. * Added `rowLimit` field for `com.databricks.sdk.service.sql.ExecuteStatementRequest`. * Added `com.databricks.sdk.service.sql.StatementParameterListItem` class. OpenAPI SHA: 5d0ccbb790d341eae8e85321a685a9e9e2d5bf24, Date: 2023-08-29
Changes
Query parameters are determined reflectively from request classes by scanning for fields with a QueryParam annotation. Serialization of query parameters is recursive in order to support complex types like the filter structures used for listing in the SQL query history service. This PR makes the following changes:
Tests
Test for this change is dependent on other testing refactors that will be merged as part of #139.