Choice classes, and their values, should be published as resources

Bug #364596 reported by Leonard Richardson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restful
Triaged
Low
Unassigned

Bug Description

We recently started publishing resources for individual fields. The goal is to make it easier for clients to query Choice fields. It looks like we also need to publish the Choice itself as a resource.

The reason is that the bugs team is publishing fields that are lists of Choices. allenap described it in bug 256940:

> IBugTaskSearchBase has three fields that are List()s of Choice()s:
> status, status_upstream, and importance. They all need to be so (*),
> because it's describing a search form.

Right now these fields are described as Lists. There's no more information than if they were lists of tags. It's impossible for launchpadlib to know the possible values for these fields. Fixing bug 256940 won't do anything for these fields.

So after we fix 256940, we should publish all registered vocabularies (registered how?) as resources under /vocabularies. GET a vocabulary and you'll see the possible values for it, each with its own URL. Now the List of Choices can be described as a list of links to vocabulary items. We'll fix up the vocabulary serializer so it will take either the name of a vocabulary item, or the URL to the vocabulary item.

There might be a way to do this by writing XML schemas instead of exposing more resources.

Changed in lazr.restful:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.