-
Hi, I'm making a generic JavaScript client for the OGC SensorThings API and stumbled on the any'ness of id (as per spec). The USGS service has alphanumeric id's and the GET for Things is https://labs.waterdata.usgs.gov/sta/v1.1/Things('USGS-09213700') A quoted call to https://sensors.bgs.ac.uk/FROST-Server/v1.1/Things('10') results in a 404 Question: What is a good way to deal with this? Especially for a generic client that does not know if id are numeric or alphanumeric. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can't have different IDs in the same table / entity type, they're either a Number or a String. FROST Client (java) does indeed test if the JSON entity in the parse tree is a number or not:
The different implementations of the {ID interface](https://github.com/FraunhoferIOSB/FROST-Client/blob/cc8508e1108743412261a5bf069f8593624a5747/src/main/java/de/fraunhofer/iosb/ilt/sta/model/Id.java) know how to output these IDs in URLs and JSON, though the |
Beta Was this translation helpful? Give feedback.
-
Cool that you're making a generic JavaScript client! |
Beta Was this translation helpful? Give feedback.
You can't have different IDs in the same table / entity type, they're either a Number or a String.
FROST Client (java) does indeed test if the JSON entity in the parse tree is a number or not:
https://github.com/FraunhoferIOSB/FROST-Client/blob/cc8508e1108743412261a5bf069f8593624a5747/src/main/java/de/fraunhofer/iosb/ilt/sta/jackson/IdDeserializer.java#L35-L39
The different implementations of the {ID interface](https://github.com/FraunhoferIOSB/FROST-Client/blob/cc8508e1108743412261a5bf069f8593624a57…