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

Can't cast from NamedTuple to Halite::Options::Type failed #38

Closed
icyleaf opened this issue Sep 11, 2018 · 0 comments
Closed

Can't cast from NamedTuple to Halite::Options::Type failed #38

icyleaf opened this issue Sep 11, 2018 · 0 comments
Labels

Comments

@icyleaf
Copy link
Owner

icyleaf commented Sep 11, 2018

accepts NamedTuple in params/json/form:

Halite.get "http url", params: {name: "foo", skill: ["a", "b"], hobbit: {work: "abc"}}

It throws an exception:

Unhandled exception: cast from NamedTuple(work: String) to Halite::Options::Type failed, at src/halite/options.cr:356:5:19 (TypeCastError)
  from src/halite/options.cr:0:5 in 'parse_params'
  from src/halite/options.cr:92:7 in 'initialize:headers:cookies:params:form:json:raw:timeout:follow:ssl:logging'
  from src/halite/options.cr:78:5 in 'new:headers:cookies:params:form:json:raw:timeout:follow:ssl:logging'
  from src/halite/options.cr:73:7 in 'new:headers:params:form:json:raw:ssl'
  from src/halite/chainable.cr:423:7 in 'options_with'
  from src/halite/chainable.cr:385:7 in 'request:headers:params:raw:ssl'
  from src/halite/chainable.cr:5:5 in 'get:params'
  from main.cr:18:1 in '__crystal_main'
  from /usr/local/Cellar/crystal/0.26.1/src/crystal/main.cr:97:5 in 'main_user_code'
  from /usr/local/Cellar/crystal/0.26.1/src/crystal/main.cr:86:7 in 'main'
  from /usr/local/Cellar/crystal/0.26.1/src/crystal/main.cr:106:3 in 'main'
@icyleaf icyleaf added the bug label Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant