1
votes

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

1

1 Answers

1
votes

This was a bug that got fixed in 3.7.5:

https://github.com/arangodb/arangodb/issues/12778 https://github.com/arangodb/arangodb/pull/12967

There doesn't seem to be a workaround for 3.7.4 and earlier versions unfortunately - adding _from explicitly as attribute doesn't help, I suppose because it's a special field which requires internal translation.