I have a built a toy server framework that provides very extensive configuration options. In configuration, one can for example define instances of modules with each providing generic options, such as logging level, path, format, module-specific options such as listening port for a http daemon etc.I've used a big JSON file for this. There is a big modules object which keys are module names, and values are module object configuration. There is a bunch of sub-levels I won't detail here. Quickly, I got hurt by a few limitations of the JSON format:There is no comment so I need to make a separate documentation for module optionsSome data structures are lacking. For example, sets. There is no syntax to hint the user if a list order and unicity matter or not.Last but not least, I found no proper way to represent foreign key constraints.Is there any other flat file human readable format that would offer this kind of features?
What are data format providing structural information?
data;configuration
See if YAML responds to your questions.YAML has many additional features lacking in JSON, including comments, extensible data types, relational anchors, strings without quotation marks, and mapping types preserving key order.Other than that, maybe XML with a good XML schema?