cheshire icon indicating copy to clipboard operation
cheshire copied to clipboard

Serializable predicate

Open martinklepsch opened this issue 8 years ago • 1 comments

To clean up data before serializing it it would be nice to have some kind of predicate if Cheshire will be able to turn x into JSON. I looked at cheshire.generate but it seems not every thing implements the JSONable protocol but instead there is this big cond handling the polymorphism.

@dakrone do you have any thoughts on this and maybe an idea how you'd like to see it implemented - if at all? :)

martinklepsch avatar May 24 '17 07:05 martinklepsch

I don't really have any input for how this would be implemented, the only requirement would be to keep the same performance characteristics that cheshire currently has.

Perhaps the cond could be made into a macro that could be used within both the generation and serializable check?

dakrone avatar Aug 04 '17 01:08 dakrone