Re:Design Token-Based UI Architecture
by spankalee on Wednesday December 18, 2024 @12:15AM
(#42448286)
You can usually do this by only being additive with the spec, and by never mixing user-defined keys and spec-defined keys in the same object.
I've only ever seen $ used before with meta properties that work across all schemas like the $ref you mentioned and $schema.
There are multiple ways to solve this, we've explored a few and we found that clearly differentiating user inputs from the spec keys was the right way to go for this use-case and our audience.
That said, there definitely are other valid ways to solve it.
As for the "pretty weird" aspect — it's definitely uncommon but it's been seen before: the $ prefix is also used by the JSON Reference ($ref): https://www.ietf.org/archive/id/draft-pbryan-zyp-json-ref-01... — and just in case, we ran this syntax past Ben Hutton (inventor of JSON Schema) to ensure we weren't doing anything silly.