Closed Rujitsuki closed 1 month ago
Hi @Rujitsuki!
I would recommend using ProductQueryVersion.v3
if you need packaging info: they are not really supported in v2
.
Alternate solution: if actually you don't care about packaging and want to stay in v2
, please list the fields you actually need instead of the default "all fields" option.
Hi @monsieurtanuki , thanks for the support! A selection of fields helped! The packaging wasn't important to me, and I'm now using ProductQueryVersion.v3
. I was surprised that the queries stopped, so I didn't even think about setting fixed fields at first. I think I can better understand what to focus on now. Thanks again!
You're welcome @Rujitsuki!
Description
When searching for products, the error
_TypeError (type 'String' is not a subtype of type 'Map<String, dynamic>' in type cast)
occasionally occurs. Apparently, in the ProductPackage model, the fields 'shape' and 'material' can either be a JSON map or a string.Expected behavior
In the response example 1 of the API documentation, 'shape', 'material' and 'recycling' appear twice, once as a string and once as a key-value pair. (Documentation)
Stacktraces
Package information
Open Food Facts package version: 3.15.0
Hopefully, I'm not misinterpreting this :)