You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Fix duplicate keys preservation of JSON data (#1163)
* Fix duplicate keys preservation of JSON data * Update issue number * Fix type annotations * Changes after review * Rewording
This commit is contained in:
committed by
GitHub
parent
e6c5cd3e4b
commit
d7ed45bbcd
@@ -15,7 +15,7 @@ from .dicts import (
|
||||
RequestQueryParamsDict,
|
||||
)
|
||||
from .exceptions import ParseError
|
||||
from ..utils import get_content_type, load_json_preserve_order
|
||||
from ..utils import get_content_type, load_json_preserve_order_and_dupe_keys
|
||||
|
||||
|
||||
class RequestItems:
|
||||
@@ -150,6 +150,6 @@ def load_text_file(item: KeyValueArg) -> str:
|
||||
|
||||
def load_json(arg: KeyValueArg, contents: str) -> JSONType:
|
||||
try:
|
||||
return load_json_preserve_order(contents)
|
||||
return load_json_preserve_order_and_dupe_keys(contents)
|
||||
except ValueError as e:
|
||||
raise ParseError(f'{arg.orig!r}: {e}')
|
||||
|
Reference in New Issue
Block a user