New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consistent response format #79
Comments
following up: {
"status": "success",
"data": {
"_id": 123456,
"name": "Lulu",
"description": "Lulu desc…"
},
"message": "User logged in"
} |
Addresses #79 This is a breaking change in the output of the API. Existing clients will likely need to be updated. Note that "metadata" and "server sent events" still need to be updated
I just started a new branch which should address the main point: consistent response format. |
fixes #79 except for /metadata/ and /watch/ routes
It seems to work fine, but now there is an error 500 on |
I cannot reproduce the error locally: >>> from camomile import Camomile
>>> client = Camomile('http://localhost:3000')
>>> client.login(USERNAME, PASSWORD)
>>> result = client.updateCorpus(CORPUS_ID, description={'test': 'test'})
>>> print(result['status'])
success
>>> print(result['data']['description'])
{'test': 'test'} Can you please clarify? |
When I try to update a corpus / media / layer / annotation from camomile-ui, using camomile-server and camomile-client-javascript, it returns an error 500. The error logged from camomile-ui does not say much:
It comes from the bluebird library used by request-promise (http://bluebirdjs.com/docs/warning-explanations.html) The error logged from camomile-client-javascript points to MongoDB:
Do you have an idea? |
Might be related to Automattic/mongoose#5870 |
and this: Automattic/mongoose#4455 |
Downgrading MongoDB to < 3.6 should solve the problem until mongoose 5.x is out. |
Just opened issue #85 as this is in fact not related to this one... |
Sometimes the api response is a message (ie:
login
respond with"success": "Authentication succeeded."
) sometimes it's an object (ie:me
respond with{ "_id": "555299eff80f910100d741d1", "description": "", "role": "user", "username": "johndoe" }
). It would be cleaner to make it consistent.For example follow jsend specs:
Successful request:
Failed request:
The text was updated successfully, but these errors were encountered: