4 ms·
For comments, adding "_comment": "..." fields can work pretty well.
by BurningFrog 2y ago
For comments, adding "_comment": "..." fields can work pretty well.
- viraptor 2y agoNot where the reader verifies the schema. And not when you want to write a long multiline comment. (Unless you want _comment1, _comment2, ...)
- btown 2y agoAn array of strings works well here! Also, you can always preprocess to remove comments before validating!
- oneeyedpigeon 2y agoIf you're preprocessing, you might as well just `grep -v ^#` and support 'real' comments.
- btown 2y agoThere's power to it being valid JSON, though; it can be stored in databases optimized for JSON payloads, and edited with JSON editors. There's a real agility to liberally sprinkling JSONFields and JSON code editors across an auto-generated admin interface like the Django admin system, knowing that you can leave breadcrumbs for colleagues, and that anything starting with a `__` is fair game for comments any time you see such a key name.