GHARIAL_API_COMPARISON.md
This report compares the OpenAPI specification at /home/neunhoef/ArangoDB/js/apps/system/_admin/aardvark/APP/api-docs.json
with the C++ implementation in /home/neunhoef/ArangoDB/arangod/RestHandler/RestGraphHandler.cpp for the /_api/gharial endpoints.
/_api/gharial (List/Create Graphs)waitForSync (optional)name (required), edgeDefinitions, isDisjoint, isSmart, options, orphanCollectionsgraphActionReadGraphs() - ✅ MatchesgraphActionCreateGraph() - ✅ Matches
waitForSync from query params/_api/gharial/{graph-name} (Read/Delete Graph)dropCollections (optional)graphActionReadGraphConfig() - ✅ MatchesgraphActionRemoveGraph() - ✅ Matches
waitForSync and dropCollections from query paramsNote: C++ also reads waitForSync param for DELETE, which is NOT documented in OpenAPI spec
/_api/gharial/{graph-name}/vertex (List/Add Vertex Collections)collection (required), optionsgraphActionReadConfig() with TRI_COL_TYPE_DOCUMENT - ✅ MatchesmodifyVertexDefinition() with CREATE action - ✅ Matches
waitForSync, createCollection from query paramsNote: C++ reads additional query params (waitForSync, createCollection) not documented in OpenAPI POST
/_api/gharial/{graph-name}/vertex/{collection-name} (Create Vertex/Remove Collection)waitForSync, returnNew (optional)x-arango-trx-id (optional)dropCollection (optional)vertexActionCreate() - ✅ Matches
waitForSync, returnNew from querymodifyVertexDefinition() with REMOVE action - ✅ Matches
waitForSync, dropCollection from queryNote: C++ reads waitForSync for DELETE, which is NOT documented in OpenAPI
/_api/gharial/{graph-name}/vertex/{collection-name}/{vertex-key} (CRUD Vertex)If-Match, If-None-Match, x-arango-trx-id (optional)waitForSync, keepNull, returnOld, returnNew (optional)If-Match, x-arango-trx-id (optional)waitForSync, keepNull, returnOld, returnNew (optional)If-Match, x-arango-trx-id (optional)waitForSync, returnOld (optional)If-Match, x-arango-trx-id (optional)vertexActionRead() - ✅ Matches
If-None-Match headerhandleRevision() for If-Match and rev query paramvertexActionUpdate() → vertexModify() → documentModify() - ✅ Matches
waitForSync, returnNew, returnOld, keepNull from queryvertexActionReplace() → vertexModify() → documentModify() - ✅ Matches
vertexActionRemove() - ✅ Matches
waitForSync, returnOld from queryIf-Match via handleRevision()/_api/gharial/{graph-name}/edge (List/Add Edge Definitions)collection, from, to (required), optionsgraphActionReadConfig() with TRI_COL_TYPE_EDGE - ✅ MatchescreateEdgeDefinition() → modifyEdgeDefinition() with CREATE - ✅ Matches/_api/gharial/{graph-name}/edge/{definition-name} (Create Edge/Modify Definition)waitForSync, returnNew (optional)x-arango-trx-id (optional)_from, _to (required)waitForSync, dropCollections (optional)collection, from, to (required), optionswaitForSync, dropCollections (optional)edgeActionCreate() - ✅ Matches
waitForSync, returnNew from queryeditEdgeDefinition() → modifyEdgeDefinition() with EDIT - ✅ Matches
waitForSync, dropCollections from queryremoveEdgeDefinition() → modifyEdgeDefinition() with REMOVE - ✅ Matches
waitForSync, dropCollections from query/_api/gharial/{graph-name}/edge/{definition-name}/{edge-key} (CRUD Edge)If-Match, If-None-Match, x-arango-trx-id (optional)waitForSync, keepNull, returnOld, returnNew (optional)If-Match, x-arango-trx-id (optional)waitForSync, keepNull, returnOld, returnNew (optional)If-Match, x-arango-trx-id (optional)_from, _to (required)waitForSync, returnOld (optional)If-Match, x-arango-trx-id (optional)edgeActionRead() - ✅ Matches
If-None-Match headerhandleRevision() for If-MatchedgeActionUpdate() → edgeModify() → documentModify() - ✅ Matches
waitForSync, returnNew, returnOld, keepNull from queryedgeActionReplace() → edgeModify() → documentModify() - ✅ Matches
edgeActionRemove() - ✅ Matches
waitForSync, returnOld from queryIf-Match via handleRevision()All 8 major endpoint groups match correctly between the OpenAPI spec and C++ implementation:
All HTTP methods are correctly implemented:
The C++ implementation reads additional query parameters that are NOT documented in the OpenAPI spec:
| Endpoint | Method | C++ Parameter | OpenAPI Status |
|---|---|---|---|
/_api/gharial/{graph} | DELETE | waitForSync | ❌ Not documented |
/_api/gharial/{graph}/vertex | POST | waitForSync | ❌ Not documented |
/_api/gharial/{graph}/vertex | POST | createCollection | ❌ Not documented |
/_api/gharial/{graph}/vertex/{collection} | DELETE | waitForSync | ❌ Not documented |
Impact: Medium - Users relying solely on OpenAPI spec may not know these parameters exist.
rev Query ParameterThe C++ implementation's handleRevision() method reads a rev query parameter in addition to the If-Match header for revision matching. This rev parameter is NOT documented in the OpenAPI spec for any endpoint.
Impact: Low - This appears to be a legacy or alternative parameter mechanism.
keepNull Default Value DifferenceThe C++ code has a comment indicating:
// Note: the default here differs from the one in the RestDocumentHandler
bool keepNull = _request->parsedValue(StaticStrings::KeepNullString, true);
The OpenAPI spec shows keepNull as optional but doesn't specify the default value explicitly. This should be verified if the default is true for gharial and false for regular documents.
Impact: Low - Likely intentional difference between APIs.
waitForSync query parameter for:
/_api/gharial/{graph}/_api/gharial/{graph}/vertex/_api/gharial/{graph}/vertex/{collection}createCollection query parameter for:
/_api/gharial/{graph}/vertexrev query parameter for revision matching (alternative to If-Match header) on:
No operations documented in OpenAPI are missing from the C++ implementation. All documented endpoints are fully implemented.
Transaction IDs: The OpenAPI spec documents x-arango-trx-id headers for several operations. While not explicitly handled in the shown C++ code, this is likely handled at a higher level in the request processing pipeline.
Response Code Variations: The OpenAPI spec shows response code 201 for PUT edge definition replacement, while code comments suggest this should be 202 (with a TODO to fix in a major release).
Error Response Code: There's a commented TODO in the C++ code about fixing the response code for graph removal in a major release (should be 201 when synchronous, currently returns 202).
Database Name Parameter: The OpenAPI paths include {database-name} parameter, but the C++ handler doesn't explicitly parse this - it's handled by the routing layer which sets the vocbase context.
Update OpenAPI spec to document:
waitForSync parameter for DELETE graph operationwaitForSync and createCollection for POST vertex collectionwaitForSync for DELETE vertex collectionrev query parameter as an alternative to If-Match headerConsider removing undocumented parameters from C++ if they're not intentionally supported, or document them properly.
Clarify default values for optional parameters like keepNull in the OpenAPI spec.
Address TODOs in the C++ code regarding response codes for consistency.