[
https://issues.apache.org/jira/browse/THRIFT-2869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15055725#comment-15055725
]
ASF GitHub Bot commented on THRIFT-2869:
----------------------------------------
Github user stigsb commented on a diff in the pull request:
https://github.com/apache/thrift/pull/299#discussion_r47478624
--- Diff: lib/json/schema.json ---
@@ -20,66 +21,78 @@
"map",
"union",
"struct",
- "exception",
"binary"
]
},
"base-type": {
- "title": "Base types",
+ "title": "Base type schema",
"type": "object",
"properties": {
"typeId": {
- "enum": [ "void", "string", "bool", "byte", "i16", "i32", "i64",
"double", "binary" ]
+ "enum": ["void", "string", "bool", "byte", "i16", "i32", "i64",
"double", "binary" ]
}
},
"required": [ "typeId" ]
},
"list-type": {
- "title": "List and set types",
+ "title": "List and set schema",
"type": "object",
"properties": {
- "typeId": { "enum": [ "list", "set" ] },
- "elemTypeId": { "$ref": "#/definitions/type-id" },
- "elemType": { "$ref": "#/definitions/type-spec" }
+ "typeId": {
+ "enum": [ "list", "set" ]
+ }
},
- "required": [ "typeId", "elemTypeId", "elemType" ]
+ "required": [ "typeId", "elemTypeId" ]
},
"map-type": {
- "title": "Map type",
+ "title": "Map schema",
"type": "object",
"properties": {
- "typeId": { "enum": [ "map" ] },
- "keyTypeId": { "$ref": "#/definitions/type-id" },
- "keyType": { "$ref": "#/definitions/type-spec" },
- "valueTypeId": { "$ref": "#/definitions/type-id" },
- "valueType": { "$ref": "#/definitions/type-spec" }
+ "typeId": {
+ "enum": [ "map" ]
+ }
},
"required": [ "typeId", "keyTypeId", "valueTypeId" ]
},
- "struct-spec": {
- "title": "Struct and union types",
+ "struct-type": {
+ "title": "Struct, union and exception schema",
"type": "object",
"properties": {
- "typeId": { "enum": [ "union", "struct" ] },
- "class": { "type": "string" }
+ "typeId": {
+ "enum": [ "union", "struct", "exception" ]
+ }
},
"required": [ "typeId", "class" ]
},
- "type-spec": {
+ "type-desc": {
+ "title": "Type descriptor schema",
"allOf": [
- { "type": "object" },
+ {
+ "type": "object",
+ "properties": {
+ "typeId": { "type": "string" },
+ "keyTypeId": { "$ref": "#/definitions/type-id" },
+ "keyType": { "$ref": "#/definitions/type-desc" },
+ "valueTypeId": { "$ref": "#/definitions/type-id" },
+ "valueType": { "$ref": "#/definitions/type-desc" },
+ "class": { "type": "string" },
+ "elemTypeId": { "$ref": "#/definitions/type-id" },
+ "elemType": { "$ref": "#/definitions/type-desc" }
--- End diff --
It's been a while, so my memory may be off here, but I seem to remember
that it was because the validator wouldn't catch failures otherwise.
> JSON: run schema validation from tests
> --------------------------------------
>
> Key: THRIFT-2869
> URL: https://issues.apache.org/jira/browse/THRIFT-2869
> Project: Thrift
> Issue Type: Improvement
> Components: JSON - Compiler
> Reporter: Stig Bakken
> Assignee: Jens Geyer
> Priority: Minor
>
> This patch makes "make check" test the JSON generator by running a schema
> validator on generated files.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)