|
56 | 56 |
|
57 | 57 | RESULT_ARG_TYPES = { |
58 | 58 | 'descending': (bool,), |
59 | | - 'endkey': (int, LONGTYPE, STRTYPE, Sequence,), |
| 59 | + 'endkey': (int, LONGTYPE, STRTYPE, Sequence, bool,), |
60 | 60 | 'endkey_docid': (STRTYPE,), |
61 | 61 | 'group': (bool,), |
62 | 62 | 'group_level': (int, LONGTYPE, NONETYPE,), |
63 | 63 | 'include_docs': (bool,), |
64 | 64 | 'inclusive_end': (bool,), |
65 | | - 'key': (int, LONGTYPE, STRTYPE, Sequence,), |
| 65 | + 'key': (int, LONGTYPE, STRTYPE, Sequence, bool,), |
66 | 66 | 'keys': (list,), |
67 | 67 | 'limit': (int, LONGTYPE, NONETYPE,), |
68 | 68 | 'reduce': (bool,), |
69 | 69 | 'skip': (int, LONGTYPE, NONETYPE,), |
70 | 70 | 'stable': (bool,), |
71 | 71 | 'stale': (STRTYPE,), |
72 | | - 'startkey': (int, LONGTYPE, STRTYPE, Sequence,), |
| 72 | + 'startkey': (int, LONGTYPE, STRTYPE, Sequence, bool,), |
73 | 73 | 'startkey_docid': (STRTYPE,), |
74 | 74 | 'update': (STRTYPE,), |
75 | 75 | } |
@@ -191,12 +191,13 @@ def py_to_couch_validate(key, val): |
191 | 191 | # Validate argument values and ensure that a boolean is not passed in |
192 | 192 | # if an integer is expected |
193 | 193 | if (not isinstance(val, RESULT_ARG_TYPES[key]) or |
194 | | - (type(val) is bool and int in RESULT_ARG_TYPES[key])): |
| 194 | + (type(val) is bool and bool not in RESULT_ARG_TYPES[key] and |
| 195 | + int in RESULT_ARG_TYPES[key])): |
195 | 196 | raise CloudantArgumentError(117, key, RESULT_ARG_TYPES[key]) |
196 | 197 | if key == 'keys': |
197 | 198 | for key_list_val in val: |
198 | 199 | if (not isinstance(key_list_val, RESULT_ARG_TYPES['key']) or |
199 | | - type(key_list_val) is bool): |
| 200 | + isinstance(key_list_val, bool)): |
200 | 201 | raise CloudantArgumentError(134, RESULT_ARG_TYPES['key']) |
201 | 202 | if key == 'stale': |
202 | 203 | if val not in ('ok', 'update_after'): |
|
0 commit comments