You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using JSONEncoder() booleans are encoded to a Number 0/1. This JSON is used to be indexed inside elasticsearch.
When fetching this data from elasticsearch, the struct's properties are defined as booleans, here JSONDecoder() is throwing an error:
"Expected to decode Bool but found a number instead."
This doesn't make much sense, as you only can go in one direction. You are able to encode (true/false) -> (0/1) but when trying to go back (0/1) -> (true/false) is not possible, you get an error.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 7cb662cc5f05588a06c7c5cae24fea9a
Issue Description:
Codable - JSONEncoder()/ JSONDecoder()
Using JSONEncoder() booleans are encoded to a Number 0/1. This JSON is used to be indexed inside elasticsearch.
When fetching this data from elasticsearch, the struct's properties are defined as booleans, here JSONDecoder() is throwing an error:
"Expected to decode Bool but found a number instead."
This doesn't make much sense, as you only can go in one direction. You are able to encode (true/false) -> (0/1) but when trying to go back (0/1) -> (true/false) is not possible, you get an error.
The text was updated successfully, but these errors were encountered: