Open leonewashoe opened 1 year ago
something like this?
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Measure Unit",
"type": "object",
"required": ["symbol", "name"],
"properties": {
"symbol": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
to validate
{
"symbol": "m",
"name": "meter"
}
What about this? with enums, we can ensure compatibility between the same quantities and define a convention.
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Measure Unit",
"type": "object",
"required": ["quantity", "unit"],
"properties": {
"quantity": {
"type": "string",
"enum": [
"length",
"temperature"
]
},
"unit": {
"type": "string",
"enum": [
"m",
"°C"
]
}
}
}
Maybe we should have a look at already existing standards for the units. Interesting links might be UCUM there are even microservices for conversion. They also have a validation microservice, which allows to validate a certain unit. Haven't used that myself, but it would be possible integrate that check in a validation step. But that would require to solve the issue first how to integrate the existing workflows in actions that do all that stuff.
Maybe we should think to a way to standardized the measure unit, in order to be sure to have consistency between similar quantities. What about defining a json schema for the measure unit?