Fork me on GitHub

Since some Metosin people hang out here, I’ll post this here as well: Is there a JSON library which lets you only read what you need from a JSON string, to save performance? Like what you would do when writing your own JSON deserializer for a type in e.g. Java or Haskell. Maybe it could be done with jsonista?


@borkdude jsonista uses Jackson and exposes the ObjectMapper. If that can be used to do it, then yes. You might need to use jackson-core and it’s streaming reads.


jsonista doesn’t have a streaming api now, PR most welcome if you want to create one.


it would be a nice feature to be able to give it something like a Schema or spec-like thing and it would do it for you. I understand it’s currently not there, but could be useful, since jsonista focuses on performance.


yes, it would be nice. you can strip away the extra keys now in two steps (jsonista + spec-tools), but it does extra things and is slower.


with the upcoming select in spec, one could create a jackson deserializer out of the definition.


hmm… actually, as the spec visitor is already ready, one could write a spec->FunctionalSerializer transformer and create an ObjectMapper out of that - should be fast. not sure if all the relevant context is available in the Jackson databind pipeline for it.


e.g. for nested maps/vectors, one needs to know how deep we are.


I guess there is enough context while parsing as the nested Java classes work.


does anyone know if its possible to just upgrade ring-swagger-ui on compojure-api 1.1.x?


an initial test of just pulling in the latest 3.41.1 version to a compojure-api 1.1.x project doesn't seem to work


oh i guess ring-swagger is only targeting swagger 2.0 anyway


@nickmbailey yes, only 2.0. there are open issues in both spec-tools & schema-tools for the OpenApi3 support. Happy to help if someone wants to start doing those.


@ikitommi it looks like the newer versions of swagger-ui still support openapi 2 though


i was confused, i really just want a newer version of the UI not support for openapi3


@juhoteperi might know how the ring-swagger supports the new UIs. I think the lates ring-swagger should support both.


ok i don't know what i was doing wrong earlier but upgrading ring-swagger and ring-swagger-ui manually in my deps list worked


i think earlier i only manually upgraded ring-swagger which gave me an old version of ring-swagger-ui still since compojure-api explicitly depends on the ui piece


so you have to manually upgrade both

👌 5