[issue2551168] Undocumented search of a property in REST API

Ralf Schlatterbeck <[email protected]> Mon, 08 Nov 2021 17:32:15 +0000
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Ralf Schlatterbeck:

In a customer tracker we have a class 'opportunity' with the key 'opportunity_id'

Searching in the REST-API for (note the '/' separating the opportunity_id part)

.../rest/data/opportunity/opportunity_id=1234567

will retrieve the opportunity with the given ID and display it like the url ended in .../opportunity

This seems to be an undocumented feature. It *is* possible to search for .../opportunity/key where key would be the key of the class we search for (which is also currently undocumented as far as I can see). And I remember that for ambiguous cases (like this one) where the key is numeric that it was permitted to add the key property in the URL to allow searching for numeric keys.

What do we do with it?

Note that this doesn't just do a search like for issue:
.../rest/data/issue?title=just%20a%20test
will find some issues in my test-tracker while the same with a '/' won't find any. So this only works for key properties.

You can reproduce this with the standard schema with
.../rest/data/status/name=open
or
.../rest/data/status/open

I think this should be documented and tests be developed...

What do you think?

----------
components: API
keywords: rest
messages: 7360
nosy: rouilj, schlatterbeck
severity: normal
status: new
title: Undocumented search of a property in REST API
type: behavior
versions: devel

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551168>
_________________________________________________