Search code examples
configuration

Configuration file format with a schema?


I'm looking for a configuration file format with a schema. Something simple like YAML, but has a schema like XSD does for XML. Does this exist?

XML is a better serialization format than it is a configuration format but combined with XSD, it makes a powerful self-documenting configuration format.

Thanks!


Solution

  • One answer is Config4*. I recommend you read Chapter 2 (overview of the configuration syntax) and Chapter 3 (overview of the C++/Java API and overview of the schema language) of the Config4* Getting Started Guide to learn enough to decide if it suits your needs. Disclosure: I developed Config4*.

    Another answer is Json, which now has its own schema language. I haven't used it, so I can't comment on its merits.