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: foobarat 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 ... ...`
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?