Dashboard API query

Hello,

I am trying to use the newly implemented /dashboard/query , but am having a little trouble to get it to respond correctly.
I am using the property “names” as given in the example body:

{
  "names": [
    {
      "match": "CONTAINS",
      "caseSensitive": false,
      "value": "123",
      "negate": true
    }
  ]
}

However, this does result in a 500, not able to deserialize data provided.
I see this is also the case for the asset query.
Queries on other properties do respond correctly.

What am I doing wrong?

Hi!

This error, which is a HTTP 500 error, will always be logged.
I tried your query locally, and this error showed up;

com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve subtype of [simple type, class org.openremote.model.query.filter.StringPredicate]: missing type id property 'predicateType' (for POJO property 'names')

.
Our HTTP API documentation isn’t great at mentioning this,
but for several props in the API query objects, like names in /dashboard/query & /asset/query,
it expects an StringPredicate object, where predicateType is indeed required.

The updated payload;

{
  "names": [
    {
      "predicateType": "string",
      "match": "CONTAINS",
      "caseSensitive": false,
      "value": "123",
      "negate": true
    }
  ]
}

Hope this helps :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.