Comments (9)
@boxxxie what version of Cheshire are you using? I'm able to run your exact example from the REPL with no problem:
∴ lein repl
nREPL server started on port 58700
REPL-y 0.1.10
Clojure 1.5.1
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
(user/sourcery function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
user=> (ns my-namespace
#_=> (:require
#_=> ;;cheshire stuff
#_=> [cheshire.core :refer :all]
#_=> [cheshire.generate :refer [add-encoder encode-str remove-encoder]]))
nil
my-namespace=> (add-encoder java.net.URI encode-str)
nil
my-namespace=> (encode (java.net.URI. "/foo"))
"\"/foo\""
from cheshire.
maybe wrap-json-response
is what i should look at, then.
from cheshire.
What versions of clj-http and cheshire are you using? There was an issue with Cheshire 5.1.0 that was fixed in 5.1.1 that might be causing this.
from cheshire.
[cheshire "5.0.2"]
from cheshire.
with 5.1.1 i have the same problem
from cheshire.
@boxxxie do you have an example of what you're trying to encode that causes this exception? From your wrap-json-response comment, I assume you're using clj-http? What version of clj-http are you using?
from cheshire.
actually, i'm using ring-json, and it uses 5.0.2
i'm encoding a datomic URI entity type.
from cheshire.
Can you give me an example response that ring-json is trying and failing to encode? I'm currently unable to reproduce this locally.
from cheshire.
actually i was wrong. ring-json may be ok (though it's using an older version of cheshire, so i brought it down as part of my project).
liberator is using something other than cheshire. i changed that and now things are working.
from cheshire.
Related Issues (20)
- Always update to latest version of Jackson, when available
- Any way to not escape the quotes HOT 2
- Suggestion: prove equivalence with clojure.data.json HOT 6
- Add support for capturing source position/locations when parsing HOT 2
- Allow key-fn like hook for value HOT 2
- Converting nested fields from java objects to clojure types doesnot work
- Custom conversion when parsing?
- `parsed-smile-seq` actually parses JSON
- Run tests against JSONTestSuite
- Resulting Array from parse not processed lazily HOT 1
- :key-fn no longer works in generate-string? HOT 1
- Using the Ubuntu Cheshire package with Clojure HOT 1
- lein unable to find cheshire on classpath HOT 1
- Security vulnerability in Jackson dependency HOT 4
- Can't convert object of type org.postgresql.util.PGobject HOT 1
- support jackson's fast number parsing/writing features HOT 1
- Update test.generative HOT 2
- Possible to support parsing copy-paste JSON? HOT 1
- Test failures with Java 21
- Deterministic parse and generate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cheshire.