Commit c4ed6b3c authored by canterafonsj's avatar canterafonsj
Browse files

Update Entity.json. Fixing Problems with allOf and additional properties

parent b6cdfb10
...@@ -29,130 +29,146 @@ ...@@ -29,130 +29,146 @@
} }
] ]
}, },
"Commons": { "observedAt": {
"type": "string",
"format": "date-time"
},
"createdAt": {
"type": "string",
"format": "date-time"
},
"modifiedAt": {
"type": "string",
"format": "date-time"
},
"datasetId": {
"type": "string",
"format": "uri"
},
"instanceId": {
"type": "string",
"format": "uri"
},
"Property": {
"type": "object", "type": "object",
"properties": { "properties": {
"observedAt": { "type": {
"type": "string", "type": "string",
"format": "date-time" "const": "Property"
},
"value": {
"type": "any"
},
"observedAt": {
"$ref": "#/definitions/observedAt"
}, },
"createdAt": { "createdAt": {
"type": "string", "$ref": "#/definitions/createdAt"
"format": "date-time"
}, },
"modifiedAt": { "modifiedAt": {
"type": "string", "$ref": "#/definitions/modifiedAt"
"format": "date-time"
}, },
"datasetId": { "datasetId": {
"type": "string", "$ref": "#/definitions/datasetId"
"format": "uri"
}, },
"instanceId": { "instanceId": {
"type": "string", "$ref": "#/definitions/instanceId"
"format": "uri"
} }
} },
}, "required": [
"Property": { "type",
"allOf": [ "value"
{ ],
"$ref": "#/definitions/Commons" "additionalProperties": {
}, "anyOf": [
{ {
"type": "object", "$ref": "#/definitions/Property"
"properties": {
"type": {
"type": "string",
"const": "Property"
},
"value": {
"type": "any"
}
}, },
"required": [ {
"type", "$ref": "#/definitions/Relationship"
"value"
],
"additionalProperties": {
"anyOf": [
{
"$ref": "#/definitions/Property"
},
{
"$ref": "#/definitions/Relationship"
}
]
} }
} ]
] }
}, },
"Relationship": { "Relationship": {
"allOf": [ "type": "object",
{ "properties": {
"$ref": "#/definitions/Commons" "type": {
"type": "string",
"const": "Relationship"
}, },
{ "object": {
"type": "object", "type": "string",
"properties": { "format": "uri"
"type": { },
"type": "string", "observedAt": {
"const": "Relationship" "$ref": "#/definitions/observedAt"
}, },
"object": { "createdAt": {
"type": "string", "$ref": "#/definitions/createdAt"
"format": "uri" },
} "modifiedAt": {
"$ref": "#/definitions/modifiedAt"
},
"datasetId": {
"$ref": "#/definitions/datasetId"
},
"instanceId": {
"$ref": "#/definitions/instanceId"
}
},
"required": [
"type",
"object"
],
"additionalProperties": {
"anyOf": [
{
"$ref": "#/definitions/Property"
}, },
"required": [ {
"type", "$ref": "#/definitions/Relationship"
"object"
],
"additionalProperties": {
"anyOf": [
{
"$ref": "#/definitions/Property"
},
{
"$ref": "#/definitions/Relationship"
}
]
} }
} ]
] }
}, },
"GeoProperty": { "GeoProperty": {
"allOf": [ "type": "object",
{ "properties": {
"$ref": "#/definitions/Commons" "type": {
"type": "string",
"const": "GeoProperty"
}, },
{ "value": {
"type": "object", "$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#"
"properties": { },
"type": { "createdAt": {
"type": "string", "$ref": "#/definitions/createdAt"
"const": "GeoProperty" },
}, "modifiedAt": {
"value": { "$ref": "#/definitions/modifiedAt"
"$ref": "https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/schema/geometry-schema.json#" },
} "datasetId": {
"$ref": "#/definitions/datasetId"
},
"instanceId": {
"$ref": "#/definitions/instanceId"
}
},
"required": [
"type",
"value"
],
"additionalProperties": {
"anyOf": [
{
"$ref": "#/definitions/Property"
}, },
"required": [ {
"type", "$ref": "#/definitions/Relationship"
"value"
],
"additionalProperties": {
"anyOf": [
{
"$ref": "#/definitions/Property"
},
{
"$ref": "#/definitions/Relationship"
}
]
} }
} ]
] }
} }
}, },
"type": "object", "type": "object",
...@@ -176,6 +192,12 @@ ...@@ -176,6 +192,12 @@
}, },
"operationSpace": { "operationSpace": {
"$ref": "#/definitions/GeoProperty" "$ref": "#/definitions/GeoProperty"
},
"createdAt": {
"$ref": "#/definitions/createdAt"
},
"modifiedAt": {
"$ref": "#/definitions/modifiedAt"
} }
}, },
"required": [ "required": [
...@@ -195,4 +217,4 @@ ...@@ -195,4 +217,4 @@
} }
] ]
} }
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment