You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While creating AETs API test I've spotted several API related bugs:
Get artifact by artifact Id for wrong artifactId returns code 500 instead of 400
request: GET: http://aet-vagrant:8181/api/artifact?company=aet&project=aet&id=99999999
response: HTTP ERROR 500
expected reposne: 400 with proper error message
Get metadata api for wrong correlationId returns error message text which doesn't describe the problem:
request: GET: http://aet-vagrant:8181/api/metadata?company=aet&project=aet&correlationId=99999999
response:{ "message": "Unable to get Suite Metadata for {company='aet', project='aet'}" }
Get metadata api for wrong suite name returns error message skipping suite name:
request: GET: http://aet-vagrant:8181/api/metadata?company=aet&project=aet&suite=no_existing_suite
response:{ "message": "Unable to get Suite Metadata for {company='aet', project='aet'}" }
expected reposne: { "message": "Unable to get Suite Metadata for no_existing_suite {company='aet', project='aet'}" }
Get metadata by suite name and version for wrong suite version returns error message text which doesn't describe the problem:
request: GET: http://aet-vagrant:8181/api/metadata?company=aet&project=aet&suite=main&version=999
response:{ "message": "Unable to get Suite Metadata for {company='aet', project='aet'}" }
Get correlationIds and versions by suite name for not existing suite returns wrong status code (404 instead of 400) with proper error message:
request: GET: http://aet-vagrant:8181/api/history?company=aet&project=aet&suite=no_existing_suite
response: 404{"message":"History not found for suite: no_existing_suite {company\u003d\u0027aet\u0027, project\u003d\u0027aet\u0027}"}
Get all locked suites returns JSON object with looks like not valid json object:
request: GET: http://aet-vagrant:8181/configs/locks
response:{aet-aet-main2=aet-aet-main2-1540988624814, aet-aet-main=aet-aet-main-1540540651320}
@mniezgodka Why would you assume the right response code for a situation when we try to get some object by id (points 1. and 5.) but object with such id doesn't exist, is 400?
I think it is clear that the proper code here is 404, as it indicates that the request structure was correct (which is true in your examples), but the requested resource with such id does not exist.
yeah it could works like that. For me both 404 and 400 fit that case, 404 is more precise but please take a look that there is an inconsistency and also api in cases: 2,3,4 (wrong/missing suite, version or correlation id) should response with 404 code. It doesn't meter for me which solution you will choose but please make sure to be consistent with rest of AET's APIs.
Version used
AET 3.0.1
Context of the issue/feature
While creating AETs API test I've spotted several API related bugs:
request: GET:
http://aet-vagrant:8181/api/artifact?company=aet&project=aet&id=99999999
response:
HTTP ERROR 500
expected reposne: 400 with proper error message
request: GET:
http://aet-vagrant:8181/api/metadata?company=aet&project=aet&correlationId=99999999
response:
{ "message": "Unable to get Suite Metadata for {company='aet', project='aet'}" }
request: GET:
http://aet-vagrant:8181/api/metadata?company=aet&project=aet&suite=no_existing_suite
response:
{ "message": "Unable to get Suite Metadata for {company='aet', project='aet'}" }
expected reposne:
{ "message": "Unable to get Suite Metadata for no_existing_suite {company='aet', project='aet'}" }
request: GET:
http://aet-vagrant:8181/api/metadata?company=aet&project=aet&suite=main&version=999
response:
{ "message": "Unable to get Suite Metadata for {company='aet', project='aet'}" }
request: GET:
http://aet-vagrant:8181/api/history?company=aet&project=aet&suite=no_existing_suite
response: 404
{"message":"History not found for suite: no_existing_suite {company\u003d\u0027aet\u0027, project\u003d\u0027aet\u0027}"}
request: GET:
http://aet-vagrant:8181/configs/locks
response:
{aet-aet-main2=aet-aet-main2-1540988624814, aet-aet-main=aet-aet-main-1540540651320}
Documentation link: https://github.com/Cognifide/aet/wiki/WebAPI
The text was updated successfully, but these errors were encountered: