Browse Source

fix(iot-hub): add type discriminator to device register request body

Jackson requires the 'type' field for @JsonTypeInfo polymorphic
deserialization of DeviceInstalledItemDescriptor.
pull/15347/head
Andrii Shvaika 7 months ago
parent
commit
8990477f91
  1. 4
      ui-ngx/src/app/core/http/iot-hub-api.service.ts

4
ui-ngx/src/app/core/http/iot-hub-api.service.ts

@ -114,12 +114,12 @@ export class IotHubApiService {
public registerDeviceInstall( public registerDeviceInstall(
versionId: string, versionId: string,
descriptor: { createdEntityIds: { entityType: string; id: string }[]; dashboardId?: { id: string } }, descriptor: { type?: string; createdEntityIds: { entityType: string; id: string }[]; dashboardId?: { id: string } },
config?: IotHubRequestConfig config?: IotHubRequestConfig
): Observable<InstallItemVersionResult> { ): Observable<InstallItemVersionResult> {
return this.http.post<InstallItemVersionResult>( return this.http.post<InstallItemVersionResult>(
`/api/iot-hub/device/register?versionId=${versionId}`, `/api/iot-hub/device/register?versionId=${versionId}`,
descriptor, { type: 'DEVICE', ...descriptor },
{ params: this.buildParams(config) } { params: this.buildParams(config) }
); );
} }

Loading…
Cancel
Save