5 ms·
An array of strings works well here! Also, you can always preprocess to remove comments before validating!
by btown 2y ago
An 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.