<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>
<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]