Closed somedaygone closed 1 year ago
FYI, it looks like this similar issue may apply to other properties like radiusScalingMethod
, barShape
, orientation
, expandCollapseToggleType
, and position
.
Try doing a find on integer enums:
"type": "integer", "enum"
My search found 34 occurrences that need to be updated for these properties.
The error is correct, 0 and 1 are the only allowed values for label > labelOrientation
. A type of "integer" and "enum" means that the values must be integers and also one of the listed values. 0 is vertical, and 1 is horizontal.
If you spot another issue, please let me know. I'll work on making this a bit more descriptive; the values of 0 and 1 are hard to discern. I'll probably end up following the convention described here, but this likely won't make it until the May Desktop release.
The whole point of a string enum is because 0 and 1 don't mean anything in this context. Just look at any of the other string enums and you'll see that these should be string enums too. If you can tell without looking it up, keep them as integer, but I have no clue what barShape = 0 could possibly mean. Thankfully almost every other enum is descriptive like this one:
"shadowPositionPreset":{
"type":"string",
"enum":[
"custom",
"top",
"topLeft",
"topRight",
"center",
"centerLeft",
"centerRight",
"bottom",
"bottomLeft",
"bottomRight"
],
"title":"Preset"
},
At a minimum, if you could add descriptions to the schema, it would help. I can find no documentation anywhere for these enums. Maybe in the title
like this?
"labelOrientation": {
"type": "integer",
"enum": [
0,
1
],
"title": "Orientation. 0 is vertial, 1 is horizontal."
},
Though I'd even be happy if you could just give the meanings here for radiusScalingMethod
, barShape
, orientation
, expandCollapseToggleType
, and position
. I can't find any doc anywhere that gives the values for these.
Sorry, just saw the link. Yes, adding a title on each integer would work. I think strings would match what is being used elsewhere, but I'm guessing that requires code changes elsewhere that won't happen for a long time. Thanks for taking this up!
I've prototyped something for the May release, it'll look something like this (have to hover over the value to get the explanation, unfortunately):
Schema snippet:
"labelOrientation": {
"type": "integer",
"oneOf": [
{
"const": 0,
"title": "Vertical"
},
{
"const": 1,
"title": "Horizontal"
}
],
"title": "Orientation"
},
this shipped awhile ago, please let me know if you see any instances of numeric enums that don't have an explanation / English display name!
When using the enumeration for labelOrientation, it yields an error.
The Schema should have something like:
(Not sure if your convention is caps or lower, and not sure which value is 0 and which is 1!)