Skip to content

Commit eb4e32c

Browse files
committed
A few edits
1 parent 980bd59 commit eb4e32c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

docs/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,9 @@ $ http --offline --print=B pie.dev/post \
782782
}
783783
```
784784
785-
Starting with 3.0, we have embedded a mini language inside HTTPie's own syntax to
786-
build complex JSON with ease. This syntax was inspired by the [JSON form](https://www.w3.org/TR/html-json-forms/)
787-
proposal for HTML, though we have changed a lot of parts to offer the best experience
788-
and reduce the number of typing-caused failures.
785+
Starting with 3.0, we have created a mini language in HTTPie's own syntax to
786+
build complex JSON objects with ease. This syntax was inspired by the [JSON form](https://www.w3.org/TR/html-json-forms/)
787+
proposal for HTML, though we have changed a lot of parts to offer the best experience.
789788
790789
#### Introduction
791790

httpie/cli/nested_json.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __init__(
146146
def reconstruct(self) -> str:
147147
if self.kind == 'key':
148148
if self.is_root:
149-
return self.accessor
149+
return str(self.accessor)
150150
return '[' + self.accessor + ']'
151151
elif self.kind == 'index':
152152
return '[' + str(self.accessor) + ']'
@@ -186,10 +186,12 @@ def expect(*kinds):
186186
cursor += 1
187187
if token.kind in kinds:
188188
return token
189-
else:
189+
elif tokens:
190190
token = tokens[-1]._replace(
191191
start=tokens[-1].end + 0, end=tokens[-1].end + 1
192192
)
193+
else:
194+
token = None
193195

194196
if len(kinds) == 1:
195197
suffix = kinds[0].to_name()
@@ -272,7 +274,7 @@ def type_check(index: int, path: Path, expected_type: Type[Any]) -> None:
272274
key, pseudo_token, message, message_kind='Type'
273275
)
274276

275-
def object_for(kind: str) -> str:
277+
def object_for(kind: str) -> Any:
276278
if kind == 'key':
277279
return {}
278280
elif kind in {'index', 'append'}:

0 commit comments

Comments
 (0)