mirror of
https://github.com/httpie/cli.git
synced 2025-08-16 03:38:26 +02:00
Add nested JSON syntax to the HTTPie DSL (#1224)
* Add support for nested JSON syntax (#1169) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Jakub Roztocil <jakub@roztocil.co> * minor improvements * unpack top level lists * Write more docs * doc style changes * fix double quotes Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr> Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
@ -79,6 +79,8 @@ class TestItemParsing:
|
||||
self.key_value_arg('Empty-Header;'),
|
||||
self.key_value_arg('list:=["a", 1, {}, false]'),
|
||||
self.key_value_arg('obj:={"a": "b"}'),
|
||||
self.key_value_arg(r'nested\[2\][a][]=1'),
|
||||
self.key_value_arg('nested[2][a][]:=1'),
|
||||
self.key_value_arg('ed='),
|
||||
self.key_value_arg('bool:=true'),
|
||||
self.key_value_arg('file@' + FILE_PATH_ARG),
|
||||
@ -105,7 +107,9 @@ class TestItemParsing:
|
||||
'ed': '',
|
||||
'string': 'value',
|
||||
'bool': True,
|
||||
'list': ['a', 1, {}, False],
|
||||
'list': ['a', 1, load_json_preserve_order_and_dupe_keys('{}'), False],
|
||||
'nested[2]': {'a': ['1']},
|
||||
'nested': [None, None, {'a': [1]}],
|
||||
'obj': load_json_preserve_order_and_dupe_keys('{"a": "b"}'),
|
||||
'string-embed': FILE_CONTENT
|
||||
}
|
||||
|
Reference in New Issue
Block a user