AUR web interface

**This is the bug tracker for the AUR web interface.**

Use this tracker to report bugs or make feature requests regarding the behaviour or implementation of the AUR software.
Please read the Reporting Bug Guidelines before filing a new task.
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

- Please report bugs related to Arch Linux official packages here: http://bugs.archlinux.org/index.php?project=1
- Please report bugs for [community] packages here: http://bugs.archlinux.org/index.php?project=5
- For any packages in the AUR contact the maintainer or leave a comment on the package's detail page.

Source Code:
https://projects.archlinux.org/aurweb.git/
Tasklist

FS#40963 - "results" value type in JSON response isn't consistent

Attached to Project: AUR web interface
Opened by Dave Reisner (falconindy) - Tuesday, 24 June 2014, 15:42 GMT
Last edited by Lukas Fleischer (lfleischer) - Tuesday, 01 July 2014, 20:03 GMT
Task Type General Gripe
Category Backend
Status Closed
Assigned To Lukas Fleischer (lfleischer)
Architecture All
Severity Low
Priority Normal
Reported Version 3.1.0
Due in Version 3.2.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I noticed this a long time ago, but never brought it up. In retrospect, I wish I had thought of it when we were discussing changes for rpc v2. Maybe something to fix in v3... The problem is that depending on the value of "type" in the RPC response, the JSON type of the "results" key can vary:

here it's a string: https://aur.archlinux.org/rpc.php?v=2&type=search&arg=-git
here it's a list of objects: https://aur.archlinux.org/rpc.php?v=2&type=search&arg=cower
here it's an object: https://aur.archlinux.org/rpc.php?v=2&type=info&arg=cower

From a client perspective, this kind of sucks. I realize that the value of "type" can be used to infer the JSON type of the results, but this is unnecessary since you can always provide a list of objects and resultcount. I'd suggest keeping the error reporting separate from the results. This even makes the "type" field unnecessary since you now have the same generic object structure for all request types.

See attached examples since flyspray eats whitespace.
This task depends upon

Closed by  Lukas Fleischer (lfleischer)
Tuesday, 01 July 2014, 20:03 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 3.2.0. Please use v3 of the RPC API.
Comment by Lukas Fleischer (lfleischer) - Tuesday, 01 July 2014, 18:29 GMT
  • Field changed: Due in Version (Undecided → 3.2.0)
Fixed in RPC v3, see 65129ce (Make results consistent in RPC replies, 2014-06-25).

Loading...