[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: JSON Schema
From: |
Konstantinos Chasialis |
Subject: |
Re: JSON Schema |
Date: |
Wed, 27 May 2020 20:08:19 +0300 |
User-agent: |
SquirrelMail/1.4.23 [email.uoa.gr] |
I have a suggestion about a change on our array.
This is the current version of it.
>"Array": {
> "type" : "object",
> "properties" : {
> "type" : {
> "type" : "string",
> "const" : "Array"
> },
> "elements" : {
> "type": "array",
> "items": {
> "type": "object",
> "anyOf" : [
> {"$ref": "#/definitions/String"},
> {"$ref": "#/definitions/Struct"},
> {"$ref": "#/definitions/Array"},
> {"$ref": "#/definitions/UnsignedInteger"},
> {"$ref": "#/definitions/Integer"},
> {"$ref": "#/definitions/Offset"}
> ]
I suggest changing it to this :
>"ArrayElemenent" : {
> "type" : "object",
> "properties" : {
> "value" : {
> "type" : "object",
> "anyOf" : [
> {"$ref": "#/definitions/String"},
> {"$ref": "#/definitions/Struct"},
> {"$ref": "#/definitions/Array"},
> {"$ref": "#/definitions/UnsignedInteger"},
> {"$ref": "#/definitions/Integer"},
> {"$ref": "#/definitions/Offset"}
> {"$ref": "#/definitions/Null"}
> ]
> },
> "offset" : {
> "type" : "object",
> "$ref" : "#/definitions/Offset"
> }
> },
> "maxProperties" : 2,
> "required" : [
> "value",
> "offset"
> ]
>},
>"Array": {
> "type" : "object",
> "properties" : {
> "type" : {
> "type" : "string",
> "const" : "Array"
> },
> "elements" : {
> "type": "array",
> "items": {
> "type": "object",
> "$ref": "#/definitions/ArrayElement"
> }
> },
> "mapping" : {
> "type" : "object",
> "oneOf" : [
> {"$ref" : "#/definitions/Mapping"},
> {"$ref" : "#/definitions/Null"}
> ]
> }
> },
> "maxProperties" : 3,
> "required" : [
> "elements",
> "type",
> "mapping"
> ]
>}
- JSON Schema, Konstantinos Chasialis, 2020/05/27
- Re: JSON Schema,
Konstantinos Chasialis <=
- Re: JSON Schema, Jose E. Marchesi, 2020/05/29