Implement improved field control spec (extra_fields etc.)

RESOLVED WONTFIX

Status

Webtools
BzAPI
RESOLVED WONTFIX
8 years ago
3 years ago

People

(Reporter: gerv, Assigned: gerv)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

We need to implement the improved spec for field control. The discussion is in bug 573195, and I _think_ (mkanat, tell me if I'm wrong) that the result is this:

- Each call has a documented non-empty default set of fields
- In some cases, that set may be "all fields"
- include_fields starts from scratch and adds fields
- exclude_fields starts from default and removes fields
- extra_fields starts from default and adds fields
  (so if default is nothing, it's the same as include_fields, and if default is 
   everything, it has no effect)
- The special value _all matches all fields
- The special value _custom matches all custom fields

If you specify more than one of the three field control parameters, the following happens:

- If include_fields is specified, the starting set is empty
- Otherwise, the starting set is the default set.
Then:
- Take the starting set
- Add the extra_fields
- Add the include_fields
- Remove the exclude_fields

Gerv
mkanat: could you confirm the above data is correct, so I don't implement the wrong thing?

Thanks,

Gerv
mkanat: ping?

Gerv
CCing dkl as he is probably implementing this in his BzAPI extension.

Gerv
(In reply to Gervase Markham [:gerv] from comment #3)
> CCing dkl as he is probably implementing this in his BzAPI extension.
> 
> Gerv

Currently I am implementing it similarly to the way you do it now so it is compatible although it doesn't seem that difficult to change to match your specification.

dkl
dkl: please change to match my spec. I hope the API I designed is mostly good enough to move across un-altered, but if we are going to make changes, this is the time because the URL people are using will change, and so they can update other parts of their code at the same time.

We should do an API review before we deploy.

Gerv
dkl: is the spec in comment 0 what's actually currently implemented in the native REST API?

Gerv
Flags: needinfo?(dkl)
(In reply to Gervase Markham [:gerv] from comment #6)
> dkl: is the spec in comment 0 what's actually currently implemented in the
> native REST API?
> 
> Gerv

The end result is pretty much what you stated in comment 0 where as the backend method may be different.

Note that is all to change once bug 1061233 is finished.

dkl
Flags: needinfo?(dkl)
BzAPI is now deprecated in favour of the shim and the native REST API, and no more bugs in it will be fixed.

Gerv
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.