biocore / microsetta-public-api

A public microservice to support The Microsetta Initiative
BSD 3-Clause "New" or "Revised" License
2 stars 4 forks source link

Metadata category API returns a non-json object #24

Closed wasade closed 4 years ago

wasade commented 4 years ago

The summary output for age_cat in Swagger reports as:

can't parse JSON.  Raw result:

[
  "teen", 
  "60s", 
  "Not provided", 
  "child", 
  "30s", 
  "50s", 
  "40s", 
  NaN, 
  "20s", 
  "70+", 
  "baby"
]

What I suspect is the object needs to come back as something like

{'category-values': [
  "teen", 
  "60s", 
  "Not provided", 
  "child", 
  "30s", 
  "50s", 
  "40s", 
  NaN, 
  "20s", 
  "70+", 
  "baby"
]}

...or something like that

gwarmstrong commented 4 years ago

AFAIK (see RFC 8259) an array by itself (not nested inside an object) is valid JSON.

The issue I see above is that there is a NaN value. See #21 . Merging that PR should fix your issue ^_^

wasade commented 4 years ago

Ah good call, merged :)