Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Empty array is not working for implicit body #1424

Closed
jcamiel opened this issue Apr 7, 2023 · 0 comments · Fixed by #1445
Closed

JSON Empty array is not working for implicit body #1424

jcamiel opened this issue Apr 7, 2023 · 0 comments · Fixed by #1445
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jcamiel
Copy link
Collaborator

jcamiel commented Apr 7, 2023

Summary

The following Hurl file is not valid, due to the implicit JSON body []

POST https://foo.com/api
["foo","bar","baz"]

POST https://foo.com/api
[1,2,3,4]

POST https://foo.com/api
[{"name": "foo"},{"name": "bar"},{"name": "baz"}]

POST https://foo.com/api
[true,false,true]

POST https://foo.com/api
{}

POST https://foo.com/api
[]
error: Parsing request section name
  --> /tmp/json.hurl:17:2
   |
17 | []
   |  ^ the section is not valid. Valid values are QueryStringParams, FormParams, MultipartFormData, Cookies or Options
   |

Output of checks

$ hurl --version
hurl 3.0.0-SNAPSHOT libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.45.1
Features (libcurl):  alt-svc AsynchDNS HSTS HTTP2 IPv6 Largefile libz NTLM NTLM_WB SPNEGO SSL UnixSockets
Features (built-in): brotli

Thanks @dermetfan

@jcamiel jcamiel added the bug Something isn't working label Apr 7, 2023
@fabricereix fabricereix self-assigned this Apr 7, 2023
@fabricereix fabricereix added this to the 3.0.0 milestone Apr 7, 2023
@fabricereix fabricereix linked a pull request Apr 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants