Skip to content

Commit

Permalink
Add schema for recipes. Fix #2.
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1504 committed Mar 24, 2015
1 parent 3a7477b commit 50b6387
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
82 changes: 82 additions & 0 deletions enums_schemas/recipes_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "recipes",
"type": "object",
"uniqueItems": true,
"additionalProperties" : {
"title": "recipes for a given output",
"type": "array",
"uniqueItems": true,
"items":{
"title": "recipe",
"properties": {
"type": {
"description": "The id of the output",
"type": "integer",
"minimum": 0
},
"count": {
"description": "The number of output",
"type": "integer",
"minimum": 1
},
"metadata": {
"description": "The metadata of output",
"type": "integer",
"minimum": 0
},
"ingredients": {
"description": "The ingredients of the recipe",
"type": "array",
"items":{
"description":"An ingredient",
"type":"object",
"properties":{
"id": {
"type": "integer",
"minimum": 0
},
"metadata":{
"type": "integer",
"minimum": 0
}
}
}
},
"inShape": {
"description": "The shape in input of the recipe",
"type":"array",
"minItems": 1,
"maxItems": 3,
"items":{
"type":"array",
"minItems": 1,
"maxItems": 3,
"items":{
"type":["integer","null"],
"description":"The id of an item of the recipe"
}
}

},
"outShape": {
"description": "The shape in output of the recipe",
"type":"array",
"minItems": 1,
"maxItems": 3,
"items":{
"type":"array",
"minItems": 1,
"maxItems": 3,
"items":{
"type":["integer","null"],
"description":"The id of an item of the recipe"
}
}

}
},
"required": ["type", "count","metadata"]
}
}
}
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var v = new Validator();

Error.stackTraceLimit=0;

var enums=["biomes","instruments","items","materials","blocks"];
var enums=["biomes","instruments","items","materials","blocks","recipes"];

describe("minecraft-data", function() {
enums.forEach(function(enumName){
Expand Down

0 comments on commit 50b6387

Please sign in to comment.