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

Allow string keys in parsed results #2

Closed
wants to merge 1 commit into from

Conversation

rm-rf-etc
Copy link
Contributor

I noticed that I was getting atoms in some of my keys, but everywhere else that I use Jason.decode/1, I get strings. This causes problems when trying to pattern match some query results. So I updated the config with this:

  json_decoder: {Jason, :decode!},
  json_encoder: {Jason, :encode!}

And I got errors:

[error] GenServer #PID<0.504.0> terminating
** (CaseClauseError) no case clause matching: {:ok, 200, %{"result" => [%{"stuff" => "asdfasdfasdf"}]}}
    (caylir) lib/caylir/graph/request.ex:50: Caylir.Graph.Request.query/3

I noticed that I was getting atoms in some of my keys, but everywhere else that I use `Jason.decode/1`, I get strings. This causes problems when trying to pattern match some query results. So I updated the config with this:
```
  json_decoder: {Jason, :decode!},
  json_encoder: {Jason, :encode!}
```
And I got errors:
```
[error] GenServer #PID<0.504.0> terminating
** (CaseClauseError) no case clause matching: {:ok, 200, %{"result" => [%{"stuff" => "asdfasdfasdf"}]}}
    (caylir) lib/caylir/graph/request.ex:50: Caylir.Graph.Request.query/3
```
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 98.611% when pulling f010d2b on rm-rf-etc:patch-1 into c35bc32 on mneudert:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 98.611% when pulling f010d2b on rm-rf-etc:patch-1 into c35bc32 on mneudert:master.

@mneudert mneudert changed the base branch from master to v0.11 November 20, 2019 17:39
@mneudert mneudert changed the base branch from v0.11 to master November 20, 2019 17:40
mneudert pushed a commit that referenced this pull request Nov 20, 2019
@mneudert
Copy link
Owner

❤️ 💛 💙 💚 💜

Cherry-picked for a bug fix release and GitHub does not like just changing the base branch of the Pull Request 🙈

@mneudert mneudert closed this Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants