-
Notifications
You must be signed in to change notification settings - Fork 64
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 middleware #97
Json middleware #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an example usage of how this middleware can be included.
[message topic-entity-name key-fn] | ||
(try | ||
(parse-string message key-fn) | ||
(catch Exception e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why generic exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kartik7153 Because, Cheshire library does not say which exceptions can be thrown.
src/ziggurat/middleware/json.clj
Outdated
If `true`, would coerce keys to keywords, and if `false` it would leave keys as strings. | ||
Default value is true." | ||
([handler-fn topic-entity-name] | ||
(parse-json handler-fn topic-entity-name true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kartik7153 true is the value of key-fn which is the third argument to parse-json.
…arse-json middleware function
0f60e55
to
50923da
Compare
@irfn I've added that in |
IMO this should be part of a separate library. @irfn, @mjayprateek mentioned that he had a conversation with you around keeping this in Ziggurat itself. |
IMHO By this rationale i would keep json in core. |
b03c20b
to
c19cbf7
Compare
c19cbf7
to
41da665
Compare
No description provided.