ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
irc_user has joined #crystal-lang
Sankalp has quit [Ping timeout: 246 seconds]
Sankalp has joined #crystal-lang
irc_user has quit [Quit: Connection closed for inactivity]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 248 seconds]
jmdaemon has quit [Ping timeout: 240 seconds]
Flipez has quit [Read error: Connection reset by peer]
Flipez has joined #crystal-lang
Flipez has quit [Client Quit]
Flipez has joined #crystal-lang
Flipez has quit [Read error: Connection reset by peer]
Flipez6 has joined #crystal-lang
Flipez6 is now known as Flipez
Flipez has quit [Changing host]
Flipez has joined #crystal-lang
irc_user has joined #crystal-lang
<FromGitter> <Dan-Do> How to force JSON.parse the UInt64 value? ⏎ `Invalid Int64: "13098380735552737907" at line 1, column 9`
<FromGitter> <Blacksmoke16> and you're just doing `JSON.parse "13098380735552737907"` to get that?
<FromGitter> <Blacksmoke16> might be worth reopening https://github.com/crystal-lang/crystal/issues/11490
<FromGitter> <Blacksmoke16> it would work if you do like `UInt64.from_json "13098380735552737907"`
<FromGitter> <stellarpower> On the topic of JSON, what would be the right way to generate a `JSON::Any` tree from a builtin Crystal type?
<FromGitter> <stellarpower> I'd like to serialise as normal, but stop before generating the actual String and keep the node tree so I can validate it
<FromGitter> <Dan-Do> > and you're just doing `JSON.parse "13098380735552737907"` to get that? ⏎ The code is `JSON.parse("data from database")`
<FromGitter> <stellarpower> I meant markup language, format, whatever one would use to describe XML, JSON, YAML, etc. I haven;t had the time to reply to the issue yet but I'll look at it again over the weekend :)
<FromGitter> <stellarpower> I was going to draw a quick diagram
irc_user has quit [Quit: Connection closed for inactivity]
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <Blacksmoke16> @stellarpower if you use `JSON::Serializable` you dont need that intermediary representation. can just keep using your objects then go to a string whenever
<FromGitter> <Blacksmoke16> such that if your objects are valid you can probably be assured the resulting JSON is as well
<FromGitter> <Blacksmoke16> @Dan-Do i re-opened https://github.com/crystal-lang/crystal/issues/11490
<FromGitter> <stellarpower> I could do, but I need to validate against the schema. Which accepts a JSON::Any
<FromGitter> <Dan-Do> Thanks @Blacksmoke16 👍
<FromGitter> <Blacksmoke16> @stellarpower yea there's not really a way to do that easily w/o doing something yourself
<FromGitter> <Blacksmoke16> e.g. add like `to_json_any` method to a bunch of stuff
<FromGitter> <stellarpower> Okay, thanks. I just need to get this working at the moment but I may swing back later and open a FR on github
<FromGitter> <Blacksmoke16> might just be easier to go to a string and sub process out to something to validate the string
<FromGitter> <stellarpower> I've run it back through JSON::parse just to get round it for now, but obviously that should make anyone shudder :p
<FromGitter> <Blacksmoke16> normally JSON::Any isnt something you *want* to have for a long period of time either
<FromGitter> <stellarpower> No, but in terms of validating against a schema I think some sort of parse tree is the right sort of structure to be passing round
<FromGitter> <Blacksmoke16> probably yea
<FromGitter> <Blacksmoke16> might be helpful if it provides a `IO` overload too
<FromGitter> <Blacksmoke16> could prob use a multiwriter to both serialize and validate it
_ht has joined #crystal-lang
jhass[m] has quit [Quit: You have been kicked for being idle]
notzmv has quit [Ping timeout: 272 seconds]
notzmv has joined #crystal-lang
<FromGitter> <stellarpower> Relates to the other open issue. A more general parsing framework the others could rely upon in the stdlib might be nice, might also be overkill.
<FromGitter> <stellarpower> Anbyway I'll add it all online whe nI get a chance
<FromGitter> <stellarpower> Thanks for your help
f1refly has quit [Read error: Connection reset by peer]
f1refly has joined #crystal-lang
_ht has quit [Remote host closed the connection]
FromGitter has quit [*.net *.split]
lanodan has quit [*.net *.split]
FromGitter has joined #crystal-lang
lanodan has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 248 seconds]