Skip to content

Conversation

@bavulapati
Copy link
Contributor

Being a repo around JSON, thought of using json here as it is supported. But thinking about the reason for having a yaml instead of JSON, it struck me that json file doesn't allow comments.
What do you think about this limitation?
Does usage of yaml hurt json schema eco system?

Being a repo around JSON, thought of using json here as it is supported.
But thinking about the reason for having a yaml instead of JSON, it
struck me that json file doesn't allow comments.
What do you think about this limitation?
Does usage of yaml hurt json schema eco system?

Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
@bavulapati
Copy link
Contributor Author

I want to finally change the file type to .yaml, so that syntax highlighting would be better with LSP.
This change is to just discuss my thoughts and gain more insights.

Copy link
Member

@jviotti jviotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good question. Lack of comments its the major complain about the JSON grammar, which is why JSON Schema has $comment. Other than comments, JSON and YAML is just a matter of taste. You see people passionate about either of them.

I personally prefer JSON as I find that the YAML grammar can get tricky very quickly and it is very easy to mess things up and not really understand why.

In any case, every JSON document can be transformed to YAML and viceversa so there is no much of a difference (other than comments I guess)

@jviotti
Copy link
Member

jviotti commented Jul 21, 2025

Does usage of yaml hurt json schema eco system?

On this, I wouldn't say it "hurts", but a common point of confusion is that many beginners don't realise YAML strictly follows the JSON data model and therefore may think that JSON Schema cannot be used to validate YAML. And that instead there exists something called YAML Schema that is a different specification (which is of course false). So there is definitely a bit of confusion out there

@jviotti jviotti merged commit 4b0f586 into sourcemeta:main Jul 21, 2025
14 checks passed
@bavulapati bavulapati deleted the use-json-instead-of-yaml branch July 21, 2025 12:17
@bavulapati bavulapati mentioned this pull request Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants