Open securedimensions opened 5 months ago
Hello Andreas!
Thank you for your feedback.
In order to reproduce the problem we appended the line
print(fsc.utils.transform_entity_to_json_dict(thing))
to your example code and got the output
{'@iot.id': 32, 'Locations': [{'description': 'and there', 'encodingType': 'application/geo+json', 'location': {'coordinates': [-115.81, 37.24], 'type': 'Point'}, 'name': 'here'}], 'description': 'I am a thing with a location', 'name': 'new thing', 'properties': {'owner': 'IOSB', 'withLocation': True}}
Here, the point coordinates are included. Is this the situation you are referring to?
In case you query the server for the newly created thing, please keep in mind to include the expand command:
for th in service.things().query().filter("name eq 'new thing'").expand("Locations").list(): print("JSON: {}".format(fsc.utils.transform_entity_to_json_dict(th)))
If you have got any further questions, feel free to ask.
Is this a bug?
When creating a Thing with
locations
, the location property of the Location entity is not rendered into JSON.Reproducing the error
1) clone the github 2) create the example as per this Github
3) The error In line
json_dict = frost_sta_client.utils.transform_entity_to_json_dict(entity)
(line 103 in base.py) renders the location entity into JSON withlocation=None
4) FROST-Server returns error
Property location must be non-NULL