- From: Nico André via GitHub <sysbot+gh@w3.org>
- Date: Wed, 21 Aug 2024 21:02:44 +0000
- To: public-design-tokens-log@w3.org
@drwpow, update on the JSON Schema investigation with [this PR](https://github.com/nclsndr/design-tokens-format-module/pull/3) On the bright side: I managed to get descent JSON Schemas for [each type](https://github.com/nclsndr/design-tokens-format-module/tree/38facd834cb0e98bcbe7fecaa219085a2ea37ac1/generated/tokens) and their values. It passes with aliasing for top level and nested refs. On the downside, I don't envision a way to generate the JSON Schema for the whole tree. The issue is quite simple: we don't have a discriminator - like $type if it was required - while traversing the token tree. Hence, it becomes easy to produce [false positives](https://github.com/nclsndr/design-tokens-format-module/blob/38facd834cb0e98bcbe7fecaa219085a2ea37ac1/tests/schemas/tokenTree.spec.ts#L22-L24). So, I feel like the JSON Schema is a step for the bare definitions. Then, each language will still need to build up the validation business rules for: - $type resolution - alias value resolution - alias from/to type mapping _– `border.color` points to a color token_ -- GitHub Notification of comment by nclsndr Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/247#issuecomment-2303008048 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 21 August 2024 21:02:45 UTC