| System |
GET /api/system/info |
GET /api/system |
Simplification. System information is the primary resource at the /system root. |
| System |
GET /api/system/scheduler |
GET /api/system/jobs |
Plural (jobs) for a list of tasks. The word "scheduler" implies an action, not a resource. |
| System |
POST /api/test |
POST /api/system/tests |
Tests are resources executed in the context of the system. Using plural and grouping under system. |
| Queries |
POST /api/query |
POST /api/queries |
Creating a new query instance is an operation on the queries collection. |
| Queries |
GET /api/query/{id}/results |
GET /api/queries/{id}/results |
Consistency with the new collection name queries. |
| Queries |
DELETE /api/query/{id} |
DELETE /api/queries/{id} |
Closing the cursor is an operation on a specific query. |
| Queries |
POST /api/query/{id}/cancel |
POST /api/queries/{id}/cancel |
The cancel action remains as a sub-resource or action on the query, but the path is now consistent. |
| Queries |
POST /api/eval |
POST /api/queries/evaluate |
One-off evaluation is a special case of a query. Grouped under the queries collection. Other action endpoints use full verbs or clear nouns (e.g., check-updates, resolve). Using evaluate aligns better with this pattern than the truncated eval. |
| Language Service |
GET /api/langservice/capabilities |
GET /api/language-service |
Simplified name. The service itself returns its capabilities. |
| Language Service |
POST /api/langservice/diagnostics |
POST /api/language-service/analyze |
analyze is a clearer description of the action than diagnostics (which is often the output). Alternatively, keep /diagnostics as the result of analysis. Note: To preserve semantics, I propose /analyze. |
| Language Service |
POST /api/langservice/completions |
POST /api/language-service/suggest |
suggest is more common for code suggestions. Or keep /completions as an LSP specification. |
| Language Service |
POST /api/langservice/hover |
POST /api/language-service/hover |
Kept, but moved to a new path. |
| Language Service |
POST /api/langservice/signature-help |
POST /api/language-service/signatures |
Plural, consistency. |
| Language Service |
POST /api/langservice/symbols |
POST /api/language-service/symbols |
Kept, moved. |
| Database |
GET /api/db |
GET /api/resources |
db is too generic. The root resource should be resources (or documents). |
| Database |
GET /api/db/resource |
GET /api/resources/{path} |
Dynamic path via path parameter instead of a separate endpoint for getting content. |
| Database |
PUT /api/db/resource |
PUT /api/resources |
Storing a resource in the database. The path is determined in the body or query parameter, but the endpoint represents an action over resources. Better option: POST /api/resources for creation, PUT /api/resources/{path} for update. |
| Database |
DELETE /api/db/resource |
DELETE /api/resources/{path} |
Removing a specific resource. |
| Database |
GET /api/db/collection (in GET) |
GET /api/collections/{path} |
Getting properties or content of a collection. |
| Database |
POST /api/db/collection |
POST /api/collections |
Creating a new collection. |
| Database |
DELETE /api/db/collection (in DELETE) |
DELETE /api/collections/{path} |
Removing a collection. |
| Database |
GET /api/db/properties |
GET /api/resources/{path}/metadata |
Metadata (properties) are a sub-resource of the source. |
| Database |
POST /api/db/permissions |
PATCH /api/resources/{path}/permissions |
Updating permissions is a state change of the resource. PATCH is more appropriate than POST. |
| Database |
POST /api/db/copy |
POST /api/resources/copy |
Copy action at the resource collection level. |
| Database |
POST /api/db/move |
POST /api/resources/move |
Move action at the resource collection level. |
| Database |
GET /api/db/sync |
GET /api/resources/sync |
Synchronization stream of resources. |
| Users |
GET /api/users/whoami |
GET /api/users/me |
Standard REST convention for the current user. |
| Users |
GET /api/users |
GET /api/users |
Kept (plural). |
| Groups |
GET /api/groups/{name} |
GET /api/groups/{name} |
Kept. |
| Groups |
DELETE /api/groups/{name} |
DELETE /api/groups/{name} |
Kept. |
| Packages |
GET /api/packages |
GET /api/packages |
Kept. |
| Packages |
POST /api/packages/install |
POST /api/packages |
Installing a package is often interpreted as creating an instance. Alternative: POST /api/packages/deploy. For clarity, I propose POST /api/packages with a body containing source or url. |
| Packages |
GET /api/packages/{name} |
GET /api/packages/{name} |
Kept. |
| Packages |
DELETE /api/packages/{name} |
DELETE /api/packages/{name} |
Kept. |
| Packages |
POST /api/packages/update-check |
POST /api/packages/check-updates |
Clearer action. |
| Search |
GET /api/search |
GET /api/search |
Kept, but could be GET /api/search/documents. |
| Site |
GET /api/site/apps |
GET /api/applications |
applications is a fuller name than apps, placed directly under the API root for better accessibility. |
| Site |
GET /api/site/resolve |
POST /api/links/resolve |
Resolving links is an action. The links group is suitable. |
Is your feature request related to a problem? Please describe.
I looked at OpenAPI from the perspective of the best practices of the REST API and current OpenAPI looks like an interface between the current eXist-db API and the user.
However, OpenAPI can serve as a new way of looking at an XML database—that is, as a repository of resources that can be manipulated in various ways: creating, modifying, deleting, and so on.
Describe the solution you'd like
I asked AI (
qwen3.5-122b) and following results makes sense to me:GET /api/system/infoGET /api/system/systemroot.GET /api/system/schedulerGET /api/system/jobsjobs) for a list of tasks. The word "scheduler" implies an action, not a resource.POST /api/testPOST /api/system/testsPOST /api/queryPOST /api/queriesqueriescollection.GET /api/query/{id}/resultsGET /api/queries/{id}/resultsqueries.DELETE /api/query/{id}DELETE /api/queries/{id}POST /api/query/{id}/cancelPOST /api/queries/{id}/cancelcancelaction remains as a sub-resource or action on the query, but the path is now consistent.POST /api/evalPOST /api/queries/evaluatequeriescollection. Other action endpoints use full verbs or clear nouns (e.g.,check-updates,resolve). Usingevaluatealigns better with this pattern than the truncatedeval.GET /api/langservice/capabilitiesGET /api/language-servicePOST /api/langservice/diagnosticsPOST /api/language-service/analyzeanalyzeis a clearer description of the action thandiagnostics(which is often the output). Alternatively, keep/diagnosticsas the result of analysis. Note: To preserve semantics, I propose/analyze.POST /api/langservice/completionsPOST /api/language-service/suggestsuggestis more common for code suggestions. Or keep/completionsas an LSP specification.POST /api/langservice/hoverPOST /api/language-service/hoverPOST /api/langservice/signature-helpPOST /api/language-service/signaturesPOST /api/langservice/symbolsPOST /api/language-service/symbolsGET /api/dbGET /api/resourcesdbis too generic. The root resource should beresources(ordocuments).GET /api/db/resourceGET /api/resources/{path}pathparameter instead of a separate endpoint for getting content.PUT /api/db/resourcePUT /api/resourcesPOST /api/resourcesfor creation,PUT /api/resources/{path}for update.DELETE /api/db/resourceDELETE /api/resources/{path}GET /api/db/collection(in GET)GET /api/collections/{path}POST /api/db/collectionPOST /api/collectionsDELETE /api/db/collection(in DELETE)DELETE /api/collections/{path}GET /api/db/propertiesGET /api/resources/{path}/metadataPOST /api/db/permissionsPATCH /api/resources/{path}/permissionsPOST /api/db/copyPOST /api/resources/copyPOST /api/db/movePOST /api/resources/moveGET /api/db/syncGET /api/resources/syncGET /api/users/whoamiGET /api/users/meGET /api/usersGET /api/usersGET /api/groups/{name}GET /api/groups/{name}DELETE /api/groups/{name}DELETE /api/groups/{name}GET /api/packagesGET /api/packagesPOST /api/packages/installPOST /api/packagesPOST /api/packages/deploy. For clarity, I proposePOST /api/packageswith a body containingsourceorurl.GET /api/packages/{name}GET /api/packages/{name}DELETE /api/packages/{name}DELETE /api/packages/{name}POST /api/packages/update-checkPOST /api/packages/check-updatesGET /api/searchGET /api/searchGET /api/search/documents.GET /api/site/appsGET /api/applicationsapplicationsis a fuller name thanapps, placed directly under the API root for better accessibility.GET /api/site/resolvePOST /api/links/resolvelinksgroup is suitable.Describe alternatives you've considered
This is just a first attempt, meant to start a discussion. That is, if it's not too late to introduce a new version of OpenAPI.
Additional context
I'm also thinking of merging
resourcesandcollectionsin one endpoint (calledcollsourcesorresections:-), or justresources).I am ready to discuss this proposal, which was prepared by AI, and refine it in greater detail.