-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase strictness of style API validation. #10779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on, @samanpwbb!
@@ -1,18 +1,18 @@ | |||
[ | |||
{ | |||
"line": 23, | |||
"message": "layers[1].paint.sky-atmosphere-sun[0]: -1 is less than the minimum value 0" | |||
"message": "layers[1].paint.sky-atmosphere-sun[0]: -1 is less than the minimum value 0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this file have been changed?
@@ -1,10 +1,10 @@ | |||
[ | |||
{ | |||
"line": 16, | |||
"message": "layers[0].paint.line-dasharray[1]: -2 is less than the minimum value 0" | |||
"message": "layers[0].paint.line-dasharray[1]: -2 is less than the minimum value 0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this file have been changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet these changes are related to using a different version of node.js to update fixtures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong preference here. Seems like a dependency switched their implementation or like someone switched to a Map
since non-numeric keys should remain ordered consistently. Could manually un-reorder them to reduce git-blame noise, but doesn't seem like big deal either way.
Back to you @jseppi |
/* | ||
* "type" is required and must be one of "vector", "raster", "raster-dem" | ||
*/ | ||
if (!acceptedSourceTypes.has(String(source.type))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use the String constructor here because gl js validation uses @mapbox/jsonlint-lines-primitives
to parse strings into JSON, which turns primitives into objects with a line number property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa fancy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/* | ||
* "type" is required and must be one of "vector", "raster", "raster-dem" | ||
*/ | ||
if (!acceptedSourceTypes.has(String(source.type))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa fancy
* Increase strictness of style API validation.
* Increase strictness of style API validation. (#10779) * Remove strictly-increasing fog range validation (#10772) * Fix #10763 (#10767) Co-authored-by: Saman Bemel-Benrud <[email protected]> Co-authored-by: Karim Naaji <[email protected]>
* Increase strictness of style API validation.
Launch Checklist
This PR makes mapbox-api-supported documentation more strict. Require 'type' and 'url' keys, and require that type is one of 'vector', 'raster', or 'raster-dem'. Styles with sources that have no type or url do not work, but it is possible to upload them to the style API.
In mapbox-api-supported spec validation, require 'type' and 'url' keys, and require that type is one of 'vector', 'raster', or 'raster-dem'.
cc: @mapbox/map-design-team @mapbox/static-apis
include before/after visuals or gifs if this PR includes visual changesdocument any changes to public APIspost benchmark scoresmanually test the debug page@mapbox/map-design-team
@mapbox/static-apis
if this PR includes style spec API or visual changestagged@mapbox/gl-native
if this PR includes shader changes or needs a native portmapbox-gl-js
changelog:<changelog></changelog>