Let's say I have a REST API that needs to return the width of an object, but that width may either be a specific value or a range of values. What would be the best practice for designing the API to handle this?
For example:
"width": 35.5
"width": {
"minimum": 34.2,
"maximum": 36.8
}
Would it be best to simply specify the same value as minimum and maximum?
"width": {
"minimum": 35.5,
"maximum": 35.5
}
Or use a different label (such as "width_range") for a range and only return one or the other?