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

Expected Hash for #[]?(key : String), not Array(JSON::Any) #1897

Open
jwoertink opened this issue Jun 4, 2024 · 0 comments
Open

Expected Hash for #[]?(key : String), not Array(JSON::Any) #1897

jwoertink opened this issue Jun 4, 2024 · 0 comments
Labels
bug needs investigation A possible bug / better docs needed. Investigate further

Comments

@jwoertink
Copy link
Member

I don't have a ton of info about this, but I started getting it a ton on my app, and the stacktrace all points to Lucky.

I think this might be related to having query params defined on a POST. I'll come back to this later but I want to track it for now.

class Reporting::Track < ApiAction
  param env : String
  param host : String

  post "/reporting/track" do
    json({env: env, host: host})
  end
end 
Exception Expected Hash for #[]?(key : String), not Array(JSON::Any) 
    /home/runner/work/_temp/crystal-1.12.1-true-undefined/share/crystal/src/json/any.cr:129:7 in '??' <file>
    /home/runner/work/joysticktv/joysticktv/lib/lucky/src/lucky/params.cr:576:7 in 'body_param' <file>
    /home/runner/work/joysticktv/joysticktv/lib/lucky/src/lucky/params.cr:141:5 in 'get_raw?' <file>
    /home/runner/work/joysticktv/joysticktv/lib/lucky/src/lucky/params.cr:114:8 in 'host' <file>
@jwoertink jwoertink added bug needs investigation A possible bug / better docs needed. Investigate further labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs investigation A possible bug / better docs needed. Investigate further
Projects
None yet
Development

No branches or pull requests

1 participant