Skip to content
Discussion options

You must be logged in to vote

Those are query parameters, and I'd say it's correct that they are array[] because they can have repeated values.

e.g. /api/ipam/ip-addresses/?device_id=1&device_id=2 shows all IP addresses which are attached to device_id 1 or device_id 2. Querying ?tag=foo&tag=bar shows all those with tag foo and tag bar. Info here.

SInce query parameters can be repeated, most libraries represent them as arrays, for example python's own parse_qs:

Data are returned as a dictionary. The dictionary keys are the unique query variable names and the values are lists of values for each name. [my emphasis]

Or in the opposite direction:

>>> import urllib.parse
>>> urllib.parse.urlencode({"device_id":[1,2],"tag"…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bluikko
Comment options

@candlerb
Comment options

Answer selected by bluikko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants