Skip to content

Commit

Permalink
require ids on layers, closes #394
Browse files Browse the repository at this point in the history
  • Loading branch information
samanpwbb committed Dec 18, 2015
1 parent a1f0723 commit ea9b3ef
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
3 changes: 2 additions & 1 deletion reference/v8.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@
"layer": {
"id": {
"type": "string",
"doc": "Unique layer name."
"doc": "Unique layer name.",
"required": true
},
"type": {
"type": "enum",
Expand Down
7 changes: 6 additions & 1 deletion test/fixture/layers.input.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 7,
"version": 8,
"sources": {
"vector": {
"type": "vector",
Expand All @@ -16,6 +16,11 @@
"source": "vector",
"source-layer": "layer"
},
{
"type": "line",
"source": "vector",
"source-layer": "source-layer"
},
{
"id": "ref",
"type": "line",
Expand Down
56 changes: 30 additions & 26 deletions test/fixture/layers.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,63 @@
"line": 14
},
{
"message": "layers[2]: \"type\" is prohibited for ref layers",
"line": 28
"message": "layers[1]: missing required property \"id\"",
"line": 19
},
{
"message": "layers[2]: \"source\" is prohibited for ref layers",
"line": 29
"message": "layers[3]: \"type\" is prohibited for ref layers",
"line": 33
},
{
"message": "layers[2]: \"source-layer\" is prohibited for ref layers",
"line": 30
"message": "layers[3]: \"source\" is prohibited for ref layers",
"line": 34
},
{
"message": "layers[2]: \"filter\" is prohibited for ref layers",
"line": 31
"message": "layers[3]: \"source-layer\" is prohibited for ref layers",
"line": 35
},
{
"message": "layers[2]: \"layout\" is prohibited for ref layers",
"line": 32
"message": "layers[3]: \"filter\" is prohibited for ref layers",
"line": 36
},
{
"message": "layers[3]: ref layer \"not-found\" not found",
"line": 36
"message": "layers[3]: \"layout\" is prohibited for ref layers",
"line": 37
},
{
"message": "layers[4]: ref cannot reference another ref layer",
"line": 40
"message": "layers[4]: ref layer \"not-found\" not found",
"line": 41
},
{
"message": "layers[5]: missing required property \"source\"",
"line": 42
"message": "layers[5]: ref cannot reference another ref layer",
"line": 45
},
{
"message": "layers[6]: source \"not-found\" not found",
"line": 49
"message": "layers[6]: missing required property \"source\"",
"line": 47
},
{
"message": "layers[7]: layer \"vector-raster-mismatch\" requires a vector source",
"message": "layers[7]: source \"not-found\" not found",
"line": 54
},
{
"message": "layers[8]: layer \"raster-vector-mismatch\" requires a raster source",
"message": "layers[8]: layer \"vector-raster-mismatch\" requires a vector source",
"line": 59
},
{
"message": "layers[10]: duplicate layer id \"duplicate\", previously used at line 63",
"line": 69
"message": "layers[9]: layer \"raster-vector-mismatch\" requires a raster source",
"line": 64
},
{
"message": "layers[11]: duplicate layer id \"duplicate\", previously used at line 68",
"line": 74
},
{
"message": "layers[11].type: expected one of [fill, line, symbol, raster, background], invalid found",
"line": 76
"message": "layers[12].type: expected one of [fill, line, symbol, circle, raster, background], invalid found",
"line": 81
},
{
"message": "layers[12]: layer \"missing-source-layer\" must specify a \"source-layer\"",
"line": 82
"message": "layers[13]: layer \"missing-source-layer\" must specify a \"source-layer\"",
"line": 87
}
]
2 changes: 1 addition & 1 deletion test/fixture/pitch.output.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"message": "pitch: number expected, string found",
"line": 3
}
]
]

0 comments on commit ea9b3ef

Please sign in to comment.