I am using ArangoDB schema validation released in 3.7 version. Schema validation happens as expected for Document collections. But for Edge collections following issue comes.
- Requirement of edge: The edge should have either id property or no properties at all (hence required key is not used), and no any other properties(hence additionalProperties is set to false).
I used the following schema and the edge instance. But the following edge instance cannot be created as the schema validation fails.
Schema used:
{
"message": "Schema validation error",
"level": "strict",
"rule": {
"properties": {
"id": {
"type": "string"
}
},
"additionalProperties": false
}
}
Edge instance creation tried using ArangoDB Web Interface :
- _from: DocCollection1/t1
- _to: DocCollection2/t2
- _key: e1
- Document body:{}
The edge can be created if I change additionalProperties to true, but it also enables to create edges with properties with any name, which I do not need.
I have searched in Arango documentation and cannot figure out why the schema validation fails for this scenario in Edge collections. Same scenario works fine in Document collections.
Environment: Single node, v3.7.2, Community Edition