Skip to content

Commit

Permalink
Merge pull request #3 from rom1504/1.8-feature-addType
Browse files Browse the repository at this point in the history
change structure of the protocol : types and states
  • Loading branch information
roblabla committed Sep 2, 2015
2 parents dcd0a18 + e0efe8a commit 87e16fe
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions enums_schemas/protocol_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "protocol",
"definitions": {
"protocol":{
"type": "object",
"properties":{
"types":{"$ref": "#/definitions/types"},
"states":{"$ref": "#/definitions/states"}
},
"required":["types","states"],
"additionalProperties": false
},
"types":{
"type": "object",
"patternProperties": {
"^[a-zA-Z]+$": {"$ref": "#/definitions/fieldType"}
},
"additionalProperties": false
},
"states":{
"type": "object",
"patternProperties": {
"^[a-z]+$": {"$ref": "#/definitions/directions"}
},
"additionalProperties": false
},
"directions": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -64,7 +87,8 @@
{"$ref": "#/definitions/container"},
{"$ref": "#/definitions/switch"},
{"$ref": "#/definitions/array"},
{"$ref": "#/definitions/buffer"}
{"$ref": "#/definitions/buffer"},
{"$ref": "#/definitions/option"}
]
},
"simpleFieldType": {
Expand All @@ -79,6 +103,14 @@
],
"additionalItems": false
},
"option": {
"type": "array",
"items":[
{"enum":["option"]},
{"$ref": "#/definitions/fieldType"}
],
"additionalItems": false
},
"switch":{
"type": "array",
"items":[
Expand Down Expand Up @@ -149,7 +181,7 @@
},
"contextualizedFieldName": {
"type": "string",
"pattern": "^(this\\.)?[a-zA-Z0-9_]+$"
"pattern": "^(this\\.)?.+$"
},
"fieldTypeArgsCount": {
"oneOf": [
Expand Down Expand Up @@ -181,9 +213,5 @@
]
}
},
"type": "object",
"patternProperties": {
"^[a-z]+$": {"$ref": "#/definitions/directions"}
},
"additionalProperties": false
"type": {"$ref": "#/definitions/protocol"}
}

0 comments on commit 87e16fe

Please sign in to comment.