[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: querying non-existing cartridge is not erroring?




> On Jan 29, 2014, at 10:10 AM, André Dietisheim <adietish redhat com> wrote:
> 
>> On 01/29/2014 04:01 PM, Jordan Liggitt wrote:
>> Typically, when using a filter which can return multiple results (e.g. https://openshift.redhat.com/broker/rest/cartridges.json?id=nodejs), an empty result set is expected rather than a 404.
> 
> hmm, so the given id-parameter is treated as filter that's matching the name portion (as opposed to the fully name with version)?
> My tests seem to confirm this. id=zen will return an empty result-set whereas ?id=zend returns a list with 2 entries. Ok, thanks for the explanation, that clears things up.
> 
> But I still think the following should return 404 since in my comprehension the url is adressing a non-existing resource. RIght?
> 
> curl -H "Accept: application/json; version=1.2" --user adietish redhat com:1q5T9o3E$ https://openshift.redhat.com/broker/rest/cartridges/bogus -X GET | json_reformat

The old behavior of cartridges/* was more like search.  The cartridge/:id endpoint should return 404

> 
> Cheers
> André
> 
>> 
>> 
>> 
>>> On 01/29/2014 09:51 AM, André Dietisheim wrote:
>>> Hi LIli, hi all
>>> 
>>> I was writing tests for the new query to get infos about a cartridge. I stumbled upon the following: When I do
>>> 
>>> curl -H "Accept: application/json; version=1.2" --user adietish redhat com:1q5T9o3E$ https://openshift.redhat.com/broker/rest/cartridges?id=bogus -X GET | json_reformat
>>> 
>>> I dont get 404 as I had expected but the following:
>>> 
>>> {
>>>    "api_version": 1.2,
>>>    "data": [
>>> 
>>>    ],
>>>    "messages": [
>>>        {
>>>            "exit_code": 0,
>>>            "field": null,
>>>            "index": null,
>>>            "severity": "info",
>>>            "text": "List bogus cartridges"
>>>        }
>>>    ],
>>>    "status": "ok",
>>>    "supported_api_versions": [
>>>        1.0,
>>>        1.1,
>>>        1.2,
>>>        1.3,
>>>        1.4,
>>>        1.5,
>>>        1.6
>>>    ],
>>>    "type": "cartridges",
>>>    "version": "1.2"
>>> }
>>> 
>>> Is this expected or a bug as I tend to think? If this is a bug, was this filed or should I?
>>> 
>>> Thanks
>>> André
>>> 
>>> _______________________________________________
>>> dev mailing list
>>> dev lists openshift redhat com
>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
> 
> _______________________________________________
> dev mailing list
> dev lists openshift redhat com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]