Closed jfabius closed 11 months ago
Thank you very much for this well-structured issue. I have adopted your suggested solution. However, I could imagine that there may still be problems with string-based ids in other places. Please do not hesitate to report them or to suggest extended functionality for this. By the way, I have closed issue #9 (also related to string based id), this was already fixed.
Cheers! Thanks for the quick action. I'll keep you updated if I find anything more.
Problem
When a FROST server is configured to use strings as Thing id's, queries for retrieving datastreams of a single thing raise errors.
Example
Out:
['some_string']
Out:
ERROR:root:Query failed with status-code 404, Not a valid path: Path /Things(some_string)/Datastreams is not valid: Encountered an error at (or somewhere around) input:1:9 Was expecting one of the following: T_LONG, T_STR_LIT Found string "some_string" of type T_NAME
Identified issue
The get_path method of class SensorThingsService (line 89-94) does not compose valid paths when the parent.id is of type string.
Proposed solution
This can be easily fixed by checking the type of the id and adding quotes.