Re: REST-API: Show retired status
"John P. Rouillard" <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.devel |
|---|---|
| Message-ID | <[email protected]> |
In message <[email protected]>, Ralf Schlatterbeck writes: >On Fri, Mar 06, 2020 at 06:03:19PM -0500, John P. Rouillard wrote: >> >> IIRC a .../rest/data/issue request won't show a retired issue? Does >> .../rest/data/issue?id=1 return only issue1 in the collection or does >> it return an empty collection? I think the latter. So getting an empty >> collection, you have achieved your goal. It does require a search >> rather than a direct lookup (so not quite so quickly a check). > >That an idea: >issue?id=1 return nothing For those following along at home, it returns an empty collection, not nothing: .../rest/data/issue?id=233 { "data": { "collection": [], "@total_size": 0 } } as opposed to rest/data/issue?id=234 { "data": { "collection": [ { "id": "234", "link": ".../rest/data/issue/234" } ], "@total_size": 1 } } >Note that I have someone programming with the API and they didn't >understand the semantics, but the above is easy to explain. Glad it will work for your use case. Your question does make me wonder if we need some way to query only for retired items using the ../rest/data/<class> mechanism. Maybe to support creating a table of retired items to unretire? Thoughts? -- -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions.