JSON query returns wrong results - same Yaml works

43 views
Skip to first unread message

Geoff Hudik

unread,
Sep 30, 2014, 12:16:16 PM9/30/14
to version...@googlegroups.com
See attached QueryV1YamlVsJsonResults.png. 

When I run a query with JSON I get back many results when there should only be one:
{"from":"Story","where":[{"number":"B-04904"}]}

When I run with the below equivalent Yaml I get back the one record I expect:
from: Story 
where: 
  Number: B-04904

Combined with the fact that most of the query.v1 examples are in Yaml I'm assuming that's the safer bet?

Also the docs should perhaps mention what content type we should be using with a yaml request. I'm using text/yaml and it seems to work but...
QueryV1YamlVsJsonResults.png

Acey Bunch

unread,
Sep 30, 2014, 1:25:31 PM9/30/14
to version...@googlegroups.com
The JSON "where" clause does not need to use an array:

{
  "from": "Story", 
  "where": {
    "Number": "B-04904"
  }
}

Note that there are some online converters that can help translate YAML to JSON (and back):

Geoff Hudik

unread,
Sep 30, 2014, 5:56:10 PM9/30/14
to version...@googlegroups.com
Thanks
Reply all
Reply to author
Forward
0 new messages