bug in the `recipes.search.v2` field `recipe_type`

83 views
Skip to first unread message

Raphael Cohen (‫רפאל כהן‬‎)

unread,
Feb 2, 2023, 4:28:13 PM2/2/23
to FatSecret Platform API
Hello.

I believe there is a bug in the `recipes.search.v2` API.

In the result, the `recipe_type.recipe_types` field is sometimes a string, and other times an array of strings. In order to deserialize the JSON correctly, most parsers require a fixed type for fields.
Therefore I strongly suggest to always use an array even if there is one recipe_type.

Observed examples of recipes:
id 62670925
"recipe_types": {"recipe_type": "Side Dish" }

expected result:
"recipe_types": {"recipe_type": ["Side Dish"] }

Kind regards,
Raphael

seba...@fatsecret.com

unread,
Feb 3, 2023, 3:12:25 AM2/3/23
to FatSecret Platform API
Hi Raphael,

Many thanks for reaching out. Our developer team has been made aware of the issue and is currently looking into it.

We will be in touch, most likely next week, once we have fully analysed the issue.

Kind regards,
The FatSecret Platform API Team

Raphael Cohen (‫רפאל כהן‬‎)

unread,
Feb 5, 2023, 2:49:53 AM2/5/23
to FatSecret Platform API
Hi, and thanks for your response.
Please note the same problem in API `recipe.get` with field `recipe_categories.recipe_category`. Example recipe ID: 41053855.

Observed:
{"recipe_category": {
  "recipe_category_name": "Scone",
  "recipe_category_url": "https:\/\/www.fatsecret.com\/recipes\/collections\/meal\/bakery-and-baked-products\/scone\/Default.aspx"
} }

Expected result:
{"recipe_category": [{
  "recipe_category_name": "Scone",
  "recipe_category_url": "https:\/\/www.fatsecret.com\/recipes\/collections\/meal\/bakery-and-baked-products\/scone\/Default.aspx"
} ]}

Kind regards

Raphael Cohen (Raphael)

unread,
Feb 16, 2023, 9:32:35 AM2/16/23
to FatSecret Platform API
hey. any news on this issue?

thanks.

seba...@fatsecret.com

unread,
Feb 16, 2023, 9:34:25 AM2/16/23
to FatSecret Platform API
Hi, thanks for following up. We have developed a fix for this which will be deployed in the next 2-3 weeks.
We will be in touch as soon as the change is live.
Kind regards,
The FatSecret Platform API Team

Raphael Cohen (Raphael)

unread,
Feb 16, 2023, 9:45:37 AM2/16/23
to FatSecret Platform API
Thank you so much for your help.

Kind regards,
Raphael

Reply all
Reply to author
Forward
0 new messages