Re: [community-group] The $ property name prefix should be unnecessary with a well-structured schema (#225)

> Those 8 keywords are special because they have to be be able to appear in objects with user-defined keys - but your keywords don't.

This isn’t correct, or I may be misunderstanding something. The current DTCG format relies on user-defined keys, nested arbitrarily, to infinite depth currently. That is precisely why we have reserved words.

I believe this would only be true _if_ we accepted your proposal to completely rework the schema format to a different structure that was more “AST-ish” and did not allow arbitrary keys. But again, the decision was made long ago to intentionally not follow that format, and at that time we’re not open to changing that.

> That in turn is leading to a bigger deign flaw which will make this schema _extremely_ clunky to consume compared to other JSON-based file formats,

This is opinionated, and I understand this is your experience and I respect it! But I do want to point out that this isn’t a shared opinion, and in my mind isn’t a technical flaw in the spec. Other consumers have had a fairly easy time traversing a schema that follows simple logic:

1. If a node has `$value`, it’s a Token node
2. otherwise, it’s a Group node

The concept of having to keep track of the [“path”](https://tr.designtokens.org/format/#groups) is something that’s also a common requirement of any type of JSON schema, e.g. [JSON pointers](https://opis.io/json-schema/2.x/pointers.html). Again, I respect your experience and don’t disagree that there are tradeoffs with the approach taken here. But I don’t think any are true technical barriers to consuming the specification (or if it is, there are parsers available like [Terrazzo](https://terrazzo.app/)!).

-- 
GitHub Notification of comment by drwpow
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/225#issuecomment-2644310428 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 7 February 2025 23:22:43 UTC