-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for interface, boolean; fix number type
- Loading branch information
1 parent
65cd778
commit f175bcd
Showing
11 changed files
with
593 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
[ | ||
{ | ||
"kind": "object", | ||
"name": "Foo", | ||
"members": [ | ||
{ | ||
"name": "bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "number" | ||
}, | ||
"optional": false, | ||
"tag": 2 | ||
}, | ||
{ | ||
"name": "baz", | ||
"type": { | ||
"kind": "string" | ||
}, | ||
"optional": false, | ||
"tag": 3 | ||
} | ||
], | ||
"minProperties": 2, | ||
"maxProperties": 2 | ||
}, | ||
{ | ||
"kind": "object", | ||
"name": "Foo2", | ||
"members": [ | ||
{ | ||
"name": "booleanBar", | ||
"type": { | ||
"kind": "boolean" | ||
}, | ||
"optional": false, | ||
"tag": 1 | ||
}, | ||
{ | ||
"name": "stringBar", | ||
"type": { | ||
"kind": "string" | ||
}, | ||
"optional": false, | ||
"tag": 2 | ||
}, | ||
{ | ||
"name": "numberBar", | ||
"type": { | ||
"kind": "number", | ||
"type": "number" | ||
}, | ||
"optional": false, | ||
"tag": 3 | ||
}, | ||
{ | ||
"name": "integerBar", | ||
"type": { | ||
"kind": "number", | ||
"type": "integer" | ||
}, | ||
"optional": false, | ||
"tag": 4 | ||
}, | ||
{ | ||
"name": "uint32Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "uint32" | ||
}, | ||
"optional": false, | ||
"tag": 5 | ||
}, | ||
{ | ||
"name": "int32Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "int32" | ||
}, | ||
"optional": false, | ||
"tag": 6 | ||
}, | ||
{ | ||
"name": "sint32Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "sint32" | ||
}, | ||
"optional": false, | ||
"tag": 7 | ||
}, | ||
{ | ||
"name": "fixed32Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "fixed32" | ||
}, | ||
"optional": false, | ||
"tag": 8 | ||
}, | ||
{ | ||
"name": "sfixed32Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "sfixed32" | ||
}, | ||
"optional": false, | ||
"tag": 9 | ||
}, | ||
{ | ||
"name": "uint64Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "uint64" | ||
}, | ||
"optional": false, | ||
"tag": 10 | ||
}, | ||
{ | ||
"name": "int64Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "int64" | ||
}, | ||
"optional": false, | ||
"tag": 11 | ||
}, | ||
{ | ||
"name": "sint64Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "sint64" | ||
}, | ||
"optional": false, | ||
"tag": 12 | ||
}, | ||
{ | ||
"name": "fixed64Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "fixed64" | ||
}, | ||
"optional": false, | ||
"tag": 13 | ||
}, | ||
{ | ||
"name": "sfixed64Bar", | ||
"type": { | ||
"kind": "number", | ||
"type": "sfixed64" | ||
}, | ||
"optional": false, | ||
"tag": 14 | ||
}, | ||
{ | ||
"name": "floatBar", | ||
"type": { | ||
"kind": "number", | ||
"type": "float" | ||
}, | ||
"optional": false, | ||
"tag": 15 | ||
}, | ||
{ | ||
"name": "doubleBar", | ||
"type": { | ||
"kind": "number", | ||
"type": "double" | ||
}, | ||
"optional": false, | ||
"tag": 16 | ||
}, | ||
{ | ||
"name": "referenceBar", | ||
"type": { | ||
"kind": "reference", | ||
"name": "Foo" | ||
}, | ||
"optional": false, | ||
"tag": 17 | ||
} | ||
], | ||
"minProperties": 17, | ||
"maxProperties": 17, | ||
"entry": "cases.json" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"$ref": "#/definitions/Foo2", | ||
"definitions": { | ||
"Foo2": { | ||
"type": "object", | ||
"properties": { | ||
"booleanBar": { | ||
"type": "boolean" | ||
}, | ||
"stringBar": { | ||
"type": "string" | ||
}, | ||
"numberBar": { | ||
"type": "number" | ||
}, | ||
"integerBar": { | ||
"type": "integer" | ||
}, | ||
"uint32Bar": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 4294967295 | ||
}, | ||
"int32Bar": { | ||
"type": "integer", | ||
"minimum": -2147483648, | ||
"maximum": 2147483647 | ||
}, | ||
"sint32Bar": { | ||
"type": "integer", | ||
"minimum": -2147483648, | ||
"maximum": 2147483647 | ||
}, | ||
"fixed32Bar": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 4294967295 | ||
}, | ||
"sfixed32Bar": { | ||
"type": "integer", | ||
"minimum": -2147483648, | ||
"maximum": 2147483647 | ||
}, | ||
"uint64Bar": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 18446744073709552000 | ||
}, | ||
"int64Bar": { | ||
"type": "integer", | ||
"minimum": -9223372036854776000, | ||
"maximum": 9223372036854776000 | ||
}, | ||
"sint64Bar": { | ||
"type": "integer", | ||
"minimum": -9223372036854776000, | ||
"maximum": 9223372036854776000 | ||
}, | ||
"fixed64Bar": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 18446744073709552000 | ||
}, | ||
"sfixed64Bar": { | ||
"type": "integer", | ||
"minimum": -9223372036854776000, | ||
"maximum": 9223372036854776000 | ||
}, | ||
"floatBar": { | ||
"type": "number" | ||
}, | ||
"doubleBar": { | ||
"type": "number" | ||
}, | ||
"referenceBar": { | ||
"$ref": "#/definitions/Foo" | ||
} | ||
}, | ||
"required": [ | ||
"booleanBar", | ||
"stringBar", | ||
"numberBar", | ||
"integerBar", | ||
"uint32Bar", | ||
"int32Bar", | ||
"sint32Bar", | ||
"fixed32Bar", | ||
"sfixed32Bar", | ||
"uint64Bar", | ||
"int64Bar", | ||
"sint64Bar", | ||
"fixed64Bar", | ||
"sfixed64Bar", | ||
"floatBar", | ||
"doubleBar", | ||
"referenceBar" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"Foo": { | ||
"type": "object", | ||
"properties": { | ||
"bar": { | ||
"type": "number" | ||
}, | ||
"baz": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"bar", | ||
"baz" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
syntax = "proto3"; | ||
|
||
message Foo { | ||
double bar = 2; | ||
string baz = 3; | ||
} | ||
|
||
message Foo2 { | ||
bool booleanBar = 1; | ||
string stringBar = 2; | ||
double numberBar = 3; | ||
int32 integerBar = 4; | ||
uint32 uint32Bar = 5; | ||
int32 int32Bar = 6; | ||
sint32 sint32Bar = 7; | ||
fixed32 fixed32Bar = 8; | ||
sfixed32 sfixed32Bar = 9; | ||
uint64 uint64Bar = 10; | ||
int64 int64Bar = 11; | ||
sint64 sint64Bar = 12; | ||
fixed64 fixed64Bar = 13; | ||
sfixed64 sfixed64Bar = 14; | ||
float floatBar = 15; | ||
double doubleBar = 16; | ||
Foo referenceBar = 17; | ||
} |
Oops, something went wrong.