Open redvivi opened 3 years ago
Ah. Yeah. Thanks for sharing more details, and sorry for the late reply!
This library doesn't parse strings to numbers. It keeps values as is.
Long type is a string 😅 ?
My interpretation is that the library does not keep the Long-typed value as it is, but parse it in a way that Bubble can’t use it.
Google’s Protobuf reference contains more details about the Long types.
See https://github.com/protobufjs/protobuf.js/issues/50 as well.
I understand, what I am saying is that using the method convert(APIResponseFromGoogle)
will end up with :
{
"_p_segment.endTimeOffset.seconds.low":5,
"_p_segment.endTimeOffset.seconds.high":0,
"_p_segment.endTimeOffset.seconds.unsigned":false,
"_p_segment.endTimeOffset.nanos":240000000
}
versus what is declared as custom object:
{
"segment":{
"endTimeOffset":{
"seconds":"5", <------ (1)
"nanos":240000000
}
}
}
resulting the parsed object as unprocessable.
So frankly speaking I have not determined yet what was the initial object representation that leads to the converted object ends up with low, high, unsigned keys, but happy to provide more data under your recommendation to investigate.
Hello,
I have an issue using this piece of code:
Object
Converted object through Bubble.io engine using
json-to-bubble
After some research, it looks like the type of (1) is of Long type, and must be converted accordingly to a number using
toNumber()
function.