From cf3b97b8de9a63a596f53555be746feb2f8ee0a5 Mon Sep 17 00:00:00 2001 From: rr- Date: Sun, 22 May 2016 11:05:18 +0200 Subject: [PATCH] server/tags: change response key Since we're using "results" everywhere else, it makes little sense for tag siblings to use "siblings" node. --- API.md | 2 +- server/szurubooru/api/tag_api.py | 2 +- server/szurubooru/tests/api/test_tag_siblings_retrieving.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/API.md b/API.md index b7d239e0..5a2c6293 100644 --- a/API.md +++ b/API.md @@ -491,7 +491,7 @@ data. ```json5 { - "siblings": [ + "results": [ { "tag": , "occurrences": diff --git a/server/szurubooru/api/tag_api.py b/server/szurubooru/api/tag_api.py index 35f5ee3b..59bc1522 100644 --- a/server/szurubooru/api/tag_api.py +++ b/server/szurubooru/api/tag_api.py @@ -100,4 +100,4 @@ class TagSiblingsApi(BaseApi): 'tag': tags.serialize_tag(sibling), 'occurrences': occurrences }) - return {'siblings': serialized_siblings} + return {'results': serialized_siblings} diff --git a/server/szurubooru/tests/api/test_tag_siblings_retrieving.py b/server/szurubooru/tests/api/test_tag_siblings_retrieving.py index 9f1af9db..37ac7de1 100644 --- a/server/szurubooru/tests/api/test_tag_siblings_retrieving.py +++ b/server/szurubooru/tests/api/test_tag_siblings_retrieving.py @@ -5,7 +5,7 @@ from szurubooru.func import util, tags def assert_results(result, expected_tag_names_and_occurrences): actual_tag_names_and_occurences = {} - for item in result['siblings']: + for item in result['results']: tag_name = item['tag']['names'][0] occurrences = item['occurrences'] actual_tag_names_and_occurences[tag_name] = occurrences