cies / htoml

TOML file format parser in Haskell
https://hackage.haskell.org/package/htoml
Other
38 stars 13 forks source link

Validation #20

Closed flip111 closed 7 years ago

flip111 commented 7 years ago

How is one suppose to validate the toml file? Maybe, as recommendation, there is a library that goes well with htoml?

cies commented 7 years ago

Validation is implicit in parsing the TOML file. If it parses it is valid. At this point there is no TOML-schema (like there is JSON-schema or XML-schema/RelaxNG), but since TOML is very easy to transpose to JSON (htoml supports this) you could use JSON-schema to validate your TOML. Bonus, if you want to validate type information that is not explicit in JSON, then you could use the ToBsJSON, which encodes the types into the JSON output.

Hope this answers your question.

flip111 commented 7 years ago

Great idea, thank you !

cies commented 7 years ago

Your welcome!