schema-driven normalization of config data #2

Open
opened 2025-03-14 18:30:56 +09:00 by uwiger · 0 comments
Owner

For readability, it's nice to use atoms and list-based strings in config files,
but this means that config data (if not already json) needs to be normalized.
One simple normalization step would be json_decode(json_encode(Data)),
but most json libraries dislike strings-as-lists, as they can't be distinguished from
arrays.

With the schema already loaded, we can easily make this distinction, though.

For readability, it's nice to use atoms and list-based strings in config files, but this means that config data (if not already json) needs to be normalized. One simple normalization step would be `json_decode(json_encode(Data))`, but most json libraries dislike strings-as-lists, as they can't be distinguished from arrays. With the schema already loaded, we can easily make this distinction, though.
Sign in to join this conversation.
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: QPQ-AG/gmconfig#2
No description provided.