Should Nuxeo CMIS return a HTTP Status 404 for an object (repository) that does not exist?

Ran the following command which attempts to retrieve repository information on a non-existent repository named “foobar”. Nuxeo CMIS returns a HTTP Status 400 invalidArgument. Should a HTTP Status 404 objectNotFound be returned instead for an object (repository) that does not exist?

$ curl -uusername:password “http://demo.nuxeo.com:80/nuxeo/atom/cmis/foobar”

`

HTTP Status 400 - invalidArgument

No such repository: foobar


org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: No such repository: foobar

    at org.nuxeo.ecm.core.opencmis.bindings.NuxeoCmisServiceFactory.getService(NuxeoCmisServiceFactory.java:65)
    at org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet.dispatch(CmisAtomPubServlet.java:213)
    at 
...
...`
0 votes

1 answers

2234 views

ANSWER



Yes we could return 404 (objectNotFound) in that case, as the CMIS 1.1 spec now says:

objectNotFound
    Cause: The service call has specified an object, an object-type or a repository that does not exist.

Note that for CMIS 1.0 the spec was simply the following, so 400 (invalidArgument) was legitimate:

objectNotFound
    Cause: The service call has specified an object that does not exist in the Repository.

Could you open a NXP ticket for this improvement?

0 votes



Note that I haven't looked yet, but it may very well be that the fix has to be in the OpenCMIS library and not Nuxeo's code.
10/02/2012

Opened JIRA https://jira.nuxeo.com/browse/NXP-10215 for this issue.
10/02/2012