diff options
author | Daniel Axtens <dja@axtens.net> | 2019-10-24 01:33:42 +1100 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2019-11-30 16:40:08 +0000 |
commit | d380219e4dd5e963f7b2b3fb421cd033e70ac5a8 (patch) | |
tree | c392a73e1a5a3a9015f961430430f12fd66e64c9 /docs/api/schemas | |
parent | 3ed6a1434dd90f073f5db5a6e85a80469aaaed40 (diff) | |
download | patchwork-d380219e4dd5e963f7b2b3fb421cd033e70ac5a8.tar patchwork-d380219e4dd5e963f7b2b3fb421cd033e70ac5a8.tar.gz |
api: support filtering patches by hash
This is a feature that the XML-RPC API has, and which is used in
the wild [1], so support it in the REST API.
I tried to version the new filter field, but it's not at all clear
how to do this with django-filters. The best way I could find
requires manually manipulating request.GET, which seems to defeat
the point of django-filters. So document it for 1.2, and have it
work on older versions as an undocumented feature.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/mricon/korg-helpers.git/tree/git-patchwork-bot.py?id=104e7374e1be8458e6d2e82478625a7bf8c822ff
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Acked-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'docs/api/schemas')
-rw-r--r-- | docs/api/schemas/latest/patchwork.yaml | 7 | ||||
-rw-r--r-- | docs/api/schemas/patchwork.j2 | 9 | ||||
-rw-r--r-- | docs/api/schemas/v1.2/patchwork.yaml | 7 |
3 files changed, 23 insertions, 0 deletions
diff --git a/docs/api/schemas/latest/patchwork.yaml b/docs/api/schemas/latest/patchwork.yaml index 4696900..6c7564b 100644 --- a/docs/api/schemas/latest/patchwork.yaml +++ b/docs/api/schemas/latest/patchwork.yaml @@ -463,6 +463,13 @@ paths: enum: - 'true' - 'false' + - in: query + name: hash + description: > + The patch hash as a case-insensitive hexadecimal string, to filter by. + schema: + title: '' + type: string responses: '200': description: '' diff --git a/docs/api/schemas/patchwork.j2 b/docs/api/schemas/patchwork.j2 index 4fc100e..12a6f67 100644 --- a/docs/api/schemas/patchwork.j2 +++ b/docs/api/schemas/patchwork.j2 @@ -468,6 +468,15 @@ paths: enum: - 'true' - 'false' +{% if version >= (1, 2) %} + - in: query + name: hash + description: > + The patch hash as a case-insensitive hexadecimal string, to filter by. + schema: + title: '' + type: string +{% endif %} responses: '200': description: '' diff --git a/docs/api/schemas/v1.2/patchwork.yaml b/docs/api/schemas/v1.2/patchwork.yaml index 2ced470..7dc9579 100644 --- a/docs/api/schemas/v1.2/patchwork.yaml +++ b/docs/api/schemas/v1.2/patchwork.yaml @@ -463,6 +463,13 @@ paths: enum: - 'true' - 'false' + - in: query + name: hash + description: > + The patch hash as a case-insensitive hexadecimal string, to filter by. + schema: + title: '' + type: string responses: '200': description: '' |