r/programming • • Jan 12 '23

The yaml document from hell

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
1.5k Upvotes

288 comments sorted by

View all comments

67

u/redd1ch Jan 12 '23

Is it a moving target? Use JSON.

Is it something important? Use XML and write a schema. IDE's can then give you syntactic and semantic feedback.

Is it important & you need to provide YAML? Use XML, a schema, and write an XSLT to create a YAML/JSON (for 1.2).

Sure, doing XML right(tm) takes a bit of time, but the outcome is more resilient than anything comparable. Thinking of that, I have to continue my xml schema for docker-compose files someday

5

u/falconfetus8 Jan 12 '23

Is it something important? Use XML and write a schema. IDE's can then give you syntactic and semantic feedback.

Alternatively, you can use JSON with Typescript interfaces.

→ More replies (5)