#23401·arangodb

`POST /_api/import` stores duplicate attribute names from document and tabular input

Author: the-ShallowCreated Oct 1, 2026Updated Oct 1, 2026

Description

Two import formats accept repeated attribute names and store invalid documents:

  1. The line-wise JSON format (type=documents) accepts an object containing the same attribute twice.
  2. The tabular format accepts a header containing the same attribute name twice.

type=array and POST /_api/document reject duplicate attributes with VPackError error: Duplicate attribute name. Documents stored through the two affected import paths are inconsistent: returning the whole document shows the last value, while d.a and indexes see the first.

Reproduction

bash
curl -s -X POST localhost:8529/_api/collection -d '{"name":"dupdocs"}'
curl -s -X POST 'localhost:8529/_api/import?collection=dupdocs&type=documents' --data-binary '{"_key":"x","a":1,"a":2}'
# {"error":false,"created":1,...}
curl -s -X POST 'localhost:8529/_api/import?collection=dupdocs&type=array' --data-binary '[{"_key":"y","a":1,"a":2}]'
# 400 "VPackError error: Duplicate attribute name"
curl -s -X POST localhost:8529/_api/cursor -d '{"query":"FOR d IN dupdocs RETURN [d, d.a]"}'
# [[{"_key":"x",...,"a":2}, 1]]

curl -s -X POST localhost:8529/_api/collection -d '{"name":"duptab"}'
printf '["_key","a","a"]\n["x",1,2]' | \
  curl -s -X POST 'localhost:8529/_api/import?collection=duptab' --data-binary @-
# {"error":false,"created":1,"errors":0,...}
curl -s -X POST localhost:8529/_api/cursor -d '{"query":"FOR d IN duptab RETURN [d, d.a]"}'
# [[{"_key":"x",...,"a":2}, 1]]

Expected

Both imports should reject the repeated attribute name without storing a document.