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

/fluree/history request JSON not serialized correctly to keywords #25

Closed
aaj3f opened this issue Feb 21, 2023 · 2 comments · Fixed by #39, fluree/db#425 or #40
Closed

/fluree/history request JSON not serialized correctly to keywords #25

aaj3f opened this issue Feb 21, 2023 · 2 comments · Fixed by #39, fluree/db#425 or #40
Assignees
Labels
bug Something isn't working
Milestone

Comments

@aaj3f
Copy link

aaj3f commented Feb 21, 2023

This message to /fluree/history

{
  "ledger": "example/time-travel",
  "query": {
     "commit-details": true,
     "t": {
        "at": "latest"
      }
   }
}

produces this error response

{
  "error": "db/invalid-query",
  "message": "History query not properly formatted. Provided {:commit-details true, :t {\"at\" \"latest\"}, :opts {:context-type :string}}"
}

where {"at": "latest"} doesn't appear to get represented as the keywords expected on the @fluree/history api signature (e.g. @(fluree/history ledger {:commit-details true :t {:at :latest}}))

@aaj3f aaj3f added the bug Something isn't working label Feb 21, 2023
@cap10morgan cap10morgan self-assigned this Feb 22, 2023
@cap10morgan cap10morgan added this to the 3.0.0-alpha2 milestone Feb 22, 2023
@cap10morgan
Copy link
Contributor

I found a nice solution to this (and many other issues of this kind) via #12 and then using the malli specs already defined in the db lib to coerce requests in here to the right format.

@aaj3f
Copy link
Author

aaj3f commented Mar 1, 2023

Thanks, @cap10morgan! #12 does fix the serialization issue. I'm getting a separate issue now where the above query doesn't actually return the expected response from setting commit-details to true, and I've made a new bug (because the behavior is correct in a REPL of db, I'm wondering if it might be something with http-api-gateway and JS camelcase <> clojure kebab case? but I'm genuinely just guessing): fluree/db#451

cap10morgan added a commit that referenced this issue Mar 6, 2023
dpetran added a commit that referenced this issue Mar 27, 2023
This builds on Wes' work to fix #25. It's a dumb solution, but it works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment