28 lines
1.2 KiB
JSON
28 lines
1.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://recipes.uuard.com/schemas/v2/unit.schema.json",
|
|
"title": "Normalized unit",
|
|
"type": "object",
|
|
"required": ["schema_version", "id", "name", "symbol", "dimension", "system"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"schema_version": { "$ref": "common.schema.json#/$defs/schemaVersion" },
|
|
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"name": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
|
|
"symbol": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
|
|
"aliases": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/nonEmptyString" }, "uniqueItems": true },
|
|
"dimension": { "type": "string", "enum": ["mass", "volume", "count", "temperature", "time", "length"] },
|
|
"system": { "type": "string", "enum": ["metric", "us_customary", "imperial", "universal"] },
|
|
"base_conversion": {
|
|
"type": "object",
|
|
"required": ["base_unit_id", "factor"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"base_unit_id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"factor": { "$ref": "common.schema.json#/$defs/positiveDecimal" },
|
|
"offset": { "type": "number", "default": 0 }
|
|
}
|
|
}
|
|
}
|
|
}
|