Skip to content

Commit

Permalink
Small schema fixes
Browse files Browse the repository at this point in the history
1. Remove `st` as required field on layer. This field was removed in
#53
2. Remove min/max on some gradient scalar properties. Scalar properties
are objects and the values are in `k`, so min/max doesn't apply at that
level. We would need to reach deeper into the object to properly apply
limits.

These were discovered using full strict mode on ajv. We may want to turn
this on in our tests, however I was having some issues with cases where
the property definition and required were split between if/then/allof
etc.
  • Loading branch information
b-wils committed Sep 6, 2024
1 parent 1497683 commit 072d7d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion schema/layers/layer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"type": "number"
}
},
"required": ["ty", "st", "ip", "op"]
"required": ["ty", "ip", "op"]
}
]
}
8 changes: 2 additions & 6 deletions schema/shapes/base-gradient.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@
"h": {
"title": "Highlight Length",
"description": "Highlight Length, as a percentage between `s` and `e`",
"$ref": "#/$defs/properties/scalar-property",
"minimum": 0,
"maximum": 1
"$ref": "#/$defs/properties/scalar-property"
},
"a": {
"title": "Highlight Angle",
"description": "Highlight Angle in clockwise degrees, relative to the direction from `s` to `e`",
"$ref": "#/$defs/properties/scalar-property",
"minimum": 0,
"maximum": 360
"$ref": "#/$defs/properties/scalar-property"
}
},
"required": [
Expand Down

0 comments on commit 072d7d1

Please sign in to comment.