<FromGitter>
<moe:busyloop.net> it's also for when you don't want to write a whole bunch of boilerplate for it 😛
<FromGitter>
<HertzDevil> well there is no deserialization here
<FromGitter>
<Blacksmoke16> it does have a `JSON.parse` in there, but nothing like `JSON::Serializable` at least
<FromGitter>
<Blacksmoke16> +1 for the name/comment tho :P
<FromGitter>
<moe:busyloop.net> yeh it's only for the way out anyway. (although i feel like some kind of filtering should be baked into stdlib at some point)
<FromGitter>
<Blacksmoke16> best you could do atm is use another shard, or use the existing annotations, having a like immutable struct for each view
<FromGitter>
<Blacksmoke16> could open an issue for it, tho TBD on if thats something that would be accepted given its getting into a fairly complex feature? :shrug:
<FromGitter>
<moe:busyloop.net> yeh, i'm trying to minimize boilerplate. most often i just want `foo.to_json(:a, :b, :c)`. although even cooler would be to also have it work with arrays/nesting, but then it obv becomes way more complicated.
<FromGitter>
<Blacksmoke16> might be able to monkey patch that in
<FromGitter>
<moe:busyloop.net> yeh, i just realized, it's actually not too bad anyway; https://carc.in/#/r/d4fz
<FromGitter>
<Blacksmoke16> still would be if one of the values was an obj/array that you also wanted to filter
<FromGitter>
<moe:busyloop.net> should be fine for my dabblings, i don't need more than that anyway. basically just wanting to strip fields from db responses before rendering them out http client.
<FromGitter>
<moe:busyloop.net> yes, if it gets more nested than that, a proper serialization framework will be needed. one with ExclusionStrategies and what not 😬
<FromGitter>
<Blacksmoke16> hehe, could also just leave it up to the user and let them deal with it :P
<FromGitter>
<moe:busyloop.net> if anyone uses my stuff they're by definition lazy and don't want to deal with anything, gotta minimize them keystrokes
<FromGitter>
<Blacksmoke16> xD fair enough
<FromGitter>
<moe:busyloop.net> oh, while i'm rambling, https://github.com/Sija/any_hash.cr is quite joyful to work with for certain things. gives me hope that crystal could actually have a hash-variant that behaves almost like a ruby hash at some point. prob more of a 4.0 think, if ever, but i'll already propose to call it `LazyHash` then :)
<FromGitter>
<Blacksmoke16> at that point is it really type safe? :P
<FromGitter>
<HertzDevil> that shard is still very far from a true any-hash
<FromGitter>
<moe:busyloop.net> in places where it matters, it can still be. sometimes you (or at least i) just want to wrap things up to bring them "elsewhere", without having to (or even being able to) explicitly type it all the way down.
<FromGitter>
<moe:busyloop.net> and yup, it's not a true-any, yet. but very helpful for incrementally building up json-serializable things. not sure if an entirely true-any is actually possible - but even in this relatively limited form i already found it very helpful.
<FromGitter>
<HertzDevil> a true any might be something like `Reference | Box(Nil) | Box(Char) | Box(Bool) | Box(Int8) | ...` ranging over all storable `Value` types
<FromGitter>
<moe:busyloop.net> yup, just wrap it up in a hash-style syntax and i'll take it :)