Re: REST-API: Show retired status

Ralf Schlatterbeck <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
On Sun, Mar 08, 2020 at 03:03:27PM -0400, John P. Rouillard wrote:
> >The underlying API supports a retired parameter for some time now.
> >So it's just exposing this in the REST API.
> 
> Yup. Maybe a query param for rest/data/<class>:
> 
>    @retired=True
>    @retired=False (default if @retired is not specified)
>    @retired=both
> 
> if True, only show retired elements
> 
> if False only show non-retired elements
> 
> if both, set retired=None in the underlying filter() API and all items:
> retired and non-retired are shown.

Sounds nice.

> I suggested True/False since @protected is a Boolean (true/anything
> else) value. I think reusing the True/False semantics even though
> @retired is a tri-valued logic value make sense.
Yes, I think so, too.

> How do you feel about using @retired with:
> 
>   rest/data/<class>/<id>?@retired=False

Hmm how about putting the retired status in the meta-information.
Currently we get for .../issue/1

link:
@etag:
type: "issue"
id: "1"

How about adding the retired status there, e.g.
retired: True

> I wonder if adding the
> retired state to the outer dict as you originally suggested is a
> better way to do this. We don't have a use case that can be solved
> only with this addition though. Maybe we defer this until we have a use
> case that requires it so we don't overcomplicate this without cause.

Yes, currently querying with ... &id= solves the problem for me.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.