procore-oss / blueprinter

Simple, Fast, and Declarative Serialization Library for Ruby
MIT License
1.14k stars 109 forks source link

Remove Custom Array-like Class Configuration #428

Closed lessthanjacob closed 3 months ago

lessthanjacob commented 5 months ago

Changelog

Discussion

This was previously discussed as an option, but was decided against due to potentially be too open.

Checklist:

jhollinger commented 5 months ago

I like the direction here. But I do think that these kinds of heuristics will always fail someone. So IMHO the important thing is to allow the user to recover from that. What if render called out to render_one or render_all? Then if render gets it wrong for \<insert obscure collection object>, the user could call render_one or render_all directly. We'd also need a "hint option" for associations...

FWIW, render_one/render_all may not be the most descriptive names. render_object and render_collection? Or just options passed to render, maybe.

lessthanjacob commented 3 months ago

Will revisit at a later time.