Closed Gollor closed 5 years ago
Hi, thanks for your interest and testing. I've found what the problem was: properties was not considered as potentially containing special types... PR is on its way!
thank you both, for finding and fixing this! PR was merged, but I'll publish the package when I get out from work. @Gollor - please use the master
branch, in case you need this version before that. Thank you!
published: https://hex.pm/packages/bolt_sips/1.2.1-rc2
Thank you for quick response! The solution works.
Though this makes me wonder if there is some way to easily encode Bolt structs into jsons. At the moment I have to do it manually via the next code:
data = if Map.has_key? data, "last_payment" do
Map.put(data, "last_payment", elem(Bolt.Sips.Types.DateTimeWithTZOffset.format_param(data["last_payment"]), 1))
else
data
end
Is it possible to make some kind of extension to Jason library so it could correctly transform the type to the string? At the moment it separates the datetime and time offset separately. I tried to dive in a little but it seems Protocol.derive only allows to control the visibility of the fields, not how they are processed. Maybe Bolt.Sips should transform types into serialized strings at the response creation? Or choose the strategy depending on options passed.
@Gollor - thank you for feedback. Making an extension to a json library i.e. Jason, probably would be out of scope for us, from the driver's perspective. But we could see the value of some utilitarian functions that could help you when needed; maybe future improvements to the Bolt.Sips.TypesHelper
module?! I'll close this issue now, but please feel free to open an improvement request, so that we can track it properly. Many thanks!!
@Gollor - we're talking about steps towards releasing the stable version of bolt_sips, and your your feedback about encoding types is discussed here: #57, in case you're interested?!
Hi, it seems that the current verison of Bolt.Sips.Response.transform is not working correctly. When i do the next neo4j query...
I get the next response:
So the DateTime doesn't get parsed correctly. Currently I solve this using the next code in my view:
This is just a workaround using the code I stripped from your Bolt.Sips.Response class.