Re: [community-group] $type should be a required property (#139)

```json
{
  "$value": "foo"
}
```

This token has the JSON type `string` and no `$type` property.
What is this?

1. a keyword `foo`
2. a string literal `"foo"`
3. neither, it is undefined and should be ignored by all tools

1 is problematic because there is no context and this can be ambiguous.
Multiple types can share the same keywords (`auto`, `initial`, ...)
This makes it impossible to derive the true type from the value.

2 is the only option that makes sense. But then why not `$type: "string"`?

3 If it is undefined and should be ignored, then why even include it in the specification?

It needs to defined now what the JSON type `string` is and what it will be used for.
Otherwise tools will make a guess. Some might use it for keywords, others might ignore it.

It is highly unusual for specification to have these large gaps in their definitions. Especially for fundamental things like basic value types.

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


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

Received on Monday, 31 October 2022 11:02:01 UTC