Skip to content

Instantly share code, notes, and snippets.

@danielrearden
Created November 28, 2024 14:40
Show Gist options
  • Save danielrearden/2351d210d6baee38f15637f7cf8137ca to your computer and use it in GitHub Desktop.
Save danielrearden/2351d210d6baee38f15637f7cf8137ca to your computer and use it in GitHub Desktop.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": {},
"properties": {
"description": { "type": "string" },
"markdown": { "type": "boolean" },
"value": {
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "placeholder" }
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "plural" },
"zero": { "type": "string" },
"one": { "type": "string" },
"two": { "type": "string" },
"few": { "type": "string" },
"many": { "type": "string" },
"other": { "type": "string" },
"options": {
"type": "object",
"additionalProperties": {},
"properties": {
"type": { "enum": ["cardinal", "ordinal"] },
"minimumIntegerDigits": { "type": "number" },
"minimumFractionDigits": { "type": "number" },
"maximumFractionDigits": { "type": "number" },
"roundingIncrement": { "enum": [1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000] },
"notation": { "enum": ["standard", "scientific", "engineering", "compactShort", "compactLong"] },
"useGrouping": { "enum": ["always", "auto", "min2", "never"] },
"signDisplay": { "enum": ["auto", "always", "exceptZero", "negative", "never"] }
}
}
},
"patternProperties": {
"^[0-9]+=$": {
"type": "string"
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "select" },
"keywords": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "datetime" },
"options": {
"type": "object",
"properties": {
"hour12": { "type": "boolean" },
"hourCycle": { "enum": ["h11", "h12", "h23", "h24"] },
"timeZone": { "type": "string" },
"dateStyle": { "enum": ["full", "long", "medium", "short"] },
"timeStyle": { "enum": ["full", "long", "medium", "short"] }
},
"additionalProperties": {}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "date" },
"options": {
"type": "object",
"properties": {
"style": { "enum": ["full", "long", "medium", "short"] }
},
"additionalProperties": {}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "time" },
"options": {
"type": "object",
"properties": {
"hour12": { "type": "boolean" },
"hourCycle": { "enum": ["h11", "h12", "h23", "h24"] },
"timeZone": { "type": "string" },
"style": { "enum": ["full", "long", "medium", "short"] }
},
"additionalProperties": {}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "relativeTime" },
"options": {
"type": "object",
"properties": {
"style": { "enum": ["long", "short", "narrow"] },
"numeric": { "enum": ["always", "auto"] }
},
"additionalProperties": {}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "enum": ["decimal", "percent"] },
"options": {
"type": "object",
"properties": {
"minimumIntegerDigits": { "type": "number" },
"minimumFractionDigits": { "type": "number" },
"maximumFractionDigits": { "type": "number" },
"roundingIncrement": { "enum": [1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000] },
"notation": { "enum": ["standard", "scientific", "engineering", "compactShort", "compactLong"] },
"useGrouping": { "enum": ["always", "auto", "min2", "never"] },
"signDisplay": { "enum": ["auto", "always", "exceptZero", "negative", "never"] }
},
"additionalProperties": {}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "currency" },
"currency": { "type": "string" },
"options": {
"type": "object",
"properties": {
"display": { "enum": ["code", "symbol", "narrowSymbol", "name"] },
"minimumIntegerDigits": { "type": "number" },
"minimumFractionDigits": { "type": "number" },
"maximumFractionDigits": { "type": "number" },
"roundingIncrement": { "enum": [1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000] },
"notation": { "enum": ["standard", "scientific", "engineering", "compactShort", "compactLong"] },
"useGrouping": { "enum": ["always", "auto", "min2", "never"] },
"signDisplay": { "enum": ["auto", "always", "exceptZero", "negative", "never"] }
},
"additionalProperties": {}
}
},
"additionalProperties": {},
"required": ["name", "type"]
},
{
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "const": "unit" },
"unit": {
"enum": [
"acre",
"bit",
"byte",
"celsius",
"centimeter",
"day",
"degree",
"fahrenheit",
"fluid-ounce",
"foot",
"gallon",
"gigabit",
"gigabyte",
"gram",
"hectare",
"hour",
"inch",
"kilobit",
"kilobyte",
"kilogram",
"kilometer",
"liter",
"megabit",
"megabyte",
"meter",
"microsecond",
"mile",
"mile-scandinavian",
"milliliter",
"millimeter",
"millisecond",
"minute",
"month",
"nanosecond",
"ounce",
"percent",
"petabyte",
"pound",
"second",
"stone",
"terabit",
"terabyte",
"week",
"yard",
"year"
]
},
"options": {
"type": "object",
"properties": {
"display": { "enum": ["long", "narrow", "short"] },
"minimumIntegerDigits": { "type": "number" },
"minimumFractionDigits": { "type": "number" },
"maximumFractionDigits": { "type": "number" },
"roundingIncrement": { "enum": [1, 2, 5, 10, 20, 25, 50, 100, 200, 250, 500, 1000, 2000, 2500, 5000] },
"notation": { "enum": ["standard", "scientific", "engineering", "compactShort", "compactLong"] },
"useGrouping": { "enum": ["always", "auto", "min2", "never"] },
"signDisplay": { "enum": ["auto", "always", "exceptZero", "negative", "never"] }
},
"additionalProperties": {}
}
},
"required": ["name", "type"]
}
]
}
}
},
"required": ["value"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment