Git Product home page Git Product logo

Comments (6)

dominique-vassard avatar dominique-vassard commented on June 5, 2024 1

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!

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on June 5, 2024 1

published: https://hex.pm/packages/bolt_sips/1.2.1-rc2

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on June 5, 2024

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 masterbranch, in case you need this version before that. Thank you!

from bolt_sips.

Gollor avatar Gollor commented on June 5, 2024

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.

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on June 5, 2024

@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!!

from bolt_sips.

florinpatrascu avatar florinpatrascu commented on June 5, 2024

@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?!

from bolt_sips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.