maritimeconnectivity / ServiceRegistry

MCP (Maritime Connectivity Platform) Service Registry API
Apache License 2.0
2 stars 2 forks source link

SECOM Query by instanceId does not work. #51

Open cjmoeller opened 12 months ago

cjmoeller commented 12 months ago

I tried to implement a MSR API call to https://msr.maritimeconnectivity.net/api/secom/v1/searchService to query a service via instance id. Supplying

{"query":{},"geometry":"","freetext":"instanceId:urn\\:mrn\\:mcp\\:service\\:mcc\\:offis\\:instance\\:ship-service-client"}

as the body results in a HTTP 400 (that is what the management-portal does), and supplying

{"query":{},"geometry":"","freetext":"instanceId: urn:mrn:mcp:service:mcc:offis:instance:ship-service-client"}

results in a HTTP 500.

oliverhaagh commented 12 months ago

@nvasta do you have an idea about why this happens?

nvasta commented 12 months ago

The double quotes in the freetext query need to be escaped otherwise they are used as special characters...(e.g. field: value)... Maybe we can find a nice way of escaping them (e.g. \:), or fix the freetext before sending it inside escaped double quotes.

For example:

{"query": {}, "geometry": "", "freetext":"instanceId:\\"urn:mrn:mcp:service:mcc:grad:instance:aton-service-client\\""}