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

keywordizing values #65

Open
smogstate opened this issue Oct 18, 2022 · 1 comment
Open

keywordizing values #65

smogstate opened this issue Oct 18, 2022 · 1 comment

Comments

@smogstate
Copy link

Hi, first of all i want to thank you guys, great projects!

We got an issue which we cant explain.
Clojure tests, function loads an json which is defined in base64 variable. Works everywhere except jenkins.
Dockerfile which is build on jenkins localy works =D

Version of library is used 0.3.6

Code:
(defn parse "Parse json" [s] #?(:cljs (js->clj (.parse js/JSON s) :keywordize-keys true) :clj (j/read-value s (j/object-mapper {:decode-key-fn true}))))

First problem we got is that library keywordize string values.
even if we turn decode-key-fn then keys are remaining strings and values are keywordized anyway.

Second problem that one json cant be readed at all. Test is exiting with exception:

#17 20.47 Exception: java.lang.NullPointerException: null #17 20.47 at jsonista.jackson.PersistentHashMapDeserializer.deserialize (PersistentHashMapDeserializer.java:37) #17 20.47 jsonista.jackson.PersistentHashMapDeserializer.deserialize (PersistentHashMapDeserializer.java:19) #17 20.47 com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer.deserialize (UntypedObjectDeserializer.java:246) #17 20.47 jsonista.jackson.PersistentVectorDeserializer.deserialize (PersistentVectorDeserializer.java:27) #17 20.47 jsonista.jackson.PersistentVectorDeserializer.deserialize (PersistentVectorDeserializer.java:15) #17 20.47 com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer.deserialize (UntypedObjectDeserializer.java:254) #17 20.47 jsonista.jackson.PersistentHashMapDeserializer.deserialize (PersistentHashMapDeserializer.java:35) #17 20.47 jsonista.jackson.PersistentHashMapDeserializer.deserialize (PersistentHashMapDeserializer.java:19) #17 20.47 com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer.deserialize (UntypedObjectDeserializer.java:246) #17 20.47 com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose (ObjectMapper.java:4202) #17 20.47 com.fasterxml.jackson.databind.ObjectMapper.readValue (ObjectMapper.java:3205) #17 20.47 com.fasterxml.jackson.databind.ObjectMapper.readValue (ObjectMapper.java:3173) #17 20.47 jsonista.core$eval6033$fn__6034.invoke (core.clj:170) #17 20.47 jsonista.core$eval5998$fn__5999$G__5989__6006.invoke (core.clj:148) #17 20.47 jsonista.core$read_value.invokeStatic (core.clj:214) #17 20.47 jsonista.core$read_value.invoke (core.clj:204) #17 20.47 glmsweb.token_utils$parse.invokeStatic (token_utils.cljc:14)

Wired thing: stack does not match source.

May be you can give us hint what it could be? Like environment variable or something.

@smogstate
Copy link
Author

It seems that this NPE raised because in that particular json there is a field with null value, and library try to keywordize it :)

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

No branches or pull requests

1 participant