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 options
  • Some 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?

closed as off-topic by user22815, Greg Burghardt, gnat, Bart van Ingen Schenau, amon Nov 24 '16 at 10:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to find or recommend tools, libraries, programming languages, resources (including books, blogs, tutorials, and examples), or projects to undertake are off-topic here as they attract opinionated answers that won't have lasting value to others. You may be able to get help in The Whiteboard, our chat room." – Community, Greg Burghardt, gnat, amon
If this question can be reworded to fit the rules in the help center, please edit the question.


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?

Not the answer you're looking for? Browse other questions tagged or ask your own question.