Changes to list_all_twins - effective 22 February 2022

list_all_twins will include location and properties in the response payload

This page covers:


Overview of the changes

From 22 February 2022, the new version of the iotics-host-lib v8 and the openapi.spec v3.0.725 will return an enriched payload of the list_all_twins_response. The additional fields are:

  • location
  • properties

This new feature is a minor breaking change as part of the new version of the iotics-host-lib and the openapi.spec.

🚧

The breaking change is located in the internal of the ListAllTwinResponsePayload only

If you are not creating a ListAllTwinResponsePayload by code there is no change and your code will still be compatible


How to update your code

Check if your code references iotic.web.rest.client.qapi.model.list_all_twins_response whilst interacting with a List All Twins API request.

The nested object type of the payload.twins field has been updated:

  • before: iotic.web.rest.client.qapi.model.twin
  • after: iotic.web.rest.client.qapi.model.list_all_twins_response_twin_details

πŸ“˜

Note

If you rely solely on JSON marshalling / unmarshalling into your own objects, this enhancement will be transparent.


Code example before changes:

[...]

old_response_payload = ListAllTwinsResponsePayload(twins=[Twin(id=TwinID(value='twinId'),
visibility=Visibility.PUBLIC)])

[...]

Code example after changes:

[...]

new_response_payload = ListAllTwinsResponsePayload(twins=[
   ListAllTwinsResponseTwinDetails(id=TwinID(value='twinId'),
      visibility=Visibility.PUBLIC,
      location=GeoLocation(lat=45.0, lon=27.5),
      properties=[ModelProperty(key='http://xmlns.com/foaf/0.1/name',
                 stringLiteralValue=StringLiteral(value='Peach'))])]
                                                   
[...]