Describe the inspiration for your proposal
JSON Schema provides annotation keywords (title, description, etc.), but offers no guidance on how to:
- Determine or declare the language of a natural-language string value in a JSON instance.
- Determine or declare the text direction (LTR, RTL, or auto) of a natural-language string value.
- Establish resource-wide defaults for language or direction that apply to multiple string fields.
Schema authors who need to represent natural language content must invent their own conventions with no standard reference to follow, leading to inconsistent interoperability.
Describe the proposal
This proposal suggests adding the W3C Note Strings on the Web: Language and Direction Metadata ("string-meta") as an informative reference to the JSON Schema spec. string-meta provides best practices for identifying the language and text direction of natural-language strings.
string-meta defines a concrete, widely-applicable serialization pattern for natural language text fields:
"field-name": {
"value": "The actual string",
"lang": "en-US",
"dir": "ltr"
}
This pattern uses existing JSON object structure. No new keywords or validation semantics are required. And it works alongside JSON Schema's existing annotation mechanism.
string-meta is a published W3C Group Note from W3C (and is transitioning to a normative document), with editors who have deep expertise in this domain.
The reference could be placed in the annotation keywords section (title, description) noting that for schemas with title or description values, string-meta provides guidance on language/direction metadata.
(If the JSON Schema develops an i18n-focused vocabulary in the future, string-meta could become a normative reference at that point.)
Describe alternatives you've considered
No response
Additional context
Describe the inspiration for your proposal
JSON Schema provides annotation keywords (
title,description, etc.), but offers no guidance on how to:Schema authors who need to represent natural language content must invent their own conventions with no standard reference to follow, leading to inconsistent interoperability.
Describe the proposal
This proposal suggests adding the W3C Note Strings on the Web: Language and Direction Metadata ("string-meta") as an informative reference to the JSON Schema spec. string-meta provides best practices for identifying the language and text direction of natural-language strings.
string-meta defines a concrete, widely-applicable serialization pattern for natural language text fields:
This pattern uses existing JSON object structure. No new keywords or validation semantics are required. And it works alongside JSON Schema's existing annotation mechanism.
string-meta is a published W3C Group Note from W3C (and is transitioning to a normative document), with editors who have deep expertise in this domain.
The reference could be placed in the annotation keywords section (
title,description) noting that for schemas withtitleordescriptionvalues, string-meta provides guidance on language/direction metadata.(If the JSON Schema develops an i18n-focused vocabulary in the future, string-meta could become a normative reference at that point.)
Describe alternatives you've considered
No response
Additional context