Questions tagged [genson]

Genson is a Java-to-JSON API, for serializing and deserializing Java to and from JSON.

Genson is a Java-to-JSON API, for serializing and deserializing Java to and from JSON.

The open source Genson project is hosted at https://github.com/owlike/genson.

Alternatives

Alternative Java-to-JSON binding solutions with similar APIs include Jackson, FastJSON, Google Gson, and svenson. Yet more Java-to-JSON libraries are listed at json.org.

Pros and Cons of the different APIs were and continue to be discussed in the https://stackoverflow.com/questions/338586/a-better-java-json-library post.

Performance

The latest performance benchmarks for Genson and other JSON serialization and deserialization solutions for Java are available at https://code.google.com/p/genson/wiki/Metrics2 and https://github.com/eishay/jvm-serializers/wiki.

60 questions
1
vote
2 answers

Genson with Jersey JsonBindingException: Could not deserialize to type class java.lang.String

In my Spring MVC Java application I'm using Jersey REST API. I am using Jackson for JSON processing. I added Genson to my project for filtering some fields for some classes. And I am trying to use Genson only for that and remaining I want to use…
iCode
  • 8,892
  • 21
  • 57
  • 91
1
vote
2 answers

Genson with Android - Proguard config

I have a problem with proguard config in Android Project. I'm using Genson to parse incoming JSON data. It is fast and there is no need for extra configuration or deserializers, because on the Server-side there is also Genson. Everything works fine…
Marian Przyszedł
  • 699
  • 1
  • 9
  • 19
1
vote
1 answer

Order matters with class metadata in Genson - Is there a work-around?

I'm using Genson to serialize + deserialize json in my android app into polymorphic objects. The JSON is coming from a variety of sources though and I can't guarantee that the @class metadata will be the first line item in the json. Walking through…
Michael
  • 703
  • 1
  • 5
  • 11
1
vote
1 answer

JSON format error using Genson

I am getting following json string as JSON response. I am using genson to generate json string. At client side, am overriding parse method of backbone collection to convert json string to collection of objects. Am not sore what is wrong with…
user3841837
  • 53
  • 1
  • 7
0
votes
1 answer

How can I auto-generate a pulsar AvroSchema class from an existing model?

I'm running Apache Pulsar schemaless where the content is often changing. Now, there is some specific data for which I've written "data" classes (derived of SQLModel, which doesn't really matter in this case). Since these models (data classes) are…
feder
  • 1,849
  • 2
  • 25
  • 43
0
votes
0 answers

Genson not using my custom Converter for inner structure in JerseyTest

I have a class hierarchy that is somewhat like below, with a custom Converter The FieldValueConverter#deserialize is NOT being called in my JerseyTest. Instead, it uses the default GensonJsonConverter which complains it can't find the appropriate…
Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121
0
votes
0 answers

Genson - exclude null properties of type Collection from serialization

I want all null properties to be ignored during serialization, as such, I have used the setSkipNull(true) in the GensonBuilder. Genson genson = new GensonBuilder().setSkipNull(true).create(); However, this seems to work only for properties that are…
João Fé
  • 331
  • 2
  • 8
0
votes
1 answer

Genson broke Application (API)

Well, as the title says since I've tried to add Genson it broke my application. Now I'm not 100% sure it has to do with Payara, but reading the error log it most certainly is. I've added Genson to my Pom.xml, wrote some code to serialize and…
Déjà vu
  • 774
  • 2
  • 9
  • 31
0
votes
2 answers

How can I parse nested json using genson?

I'm getting results from a REST API, it is a list of json object representing users with nested json objects inside each user. My problem is that nested properties names do not correspond to the bean properties I got in my code. But they are so…
Loup Ollivier
  • 89
  • 2
  • 7
0
votes
1 answer

How to use @JsonConverter with Genson?

I'm trying to serialise an object with a Long id to JSON, using Genson. It works well if I serialise to JSON and back into Java. But I'm deserialising in JavaScript. JavaScript can't support a full 64-bit unsigned int as a Number (I'm finding…
Capn Sparrow
  • 2,030
  • 2
  • 15
  • 32
0
votes
1 answer

JAX-RS (Genson + jersey) : Object Not converted to json

I have a sample rest application that runs on tomcat. When replying - an object of type ActionError is sent to client as a json string. ActionError will pass to the client an Array of Strings2 Array of FieldErrors An arbitrary Object payload…
PKey
  • 3,715
  • 1
  • 14
  • 39
0
votes
1 answer

Transform map into key value pairs with Genson

I am using Genson to serialize a Java class into JSON. One of the class members is a Map, which I need to serialize directly into name/value pairs. For example: public class Demo { String name; Map mp = new HashMap<>(); …
tkja
  • 1,950
  • 5
  • 22
  • 40
0
votes
0 answers

NPE when deserializing since upgrade Jersey 2.26 from 2.25.2

I am trying to upgrade to Jersey 2.26. I have added the new hk2 dependencies that are needed: org.glassfish.jersey.inject jersey-hk2 I use the jersey-bom…
Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121
0
votes
1 answer

not able to serialize scala class using genson

I have a problem where i can't get toJson to work with Scala classes. It outputs an empty json string. : {} The classes have their member variables populated. I tried both a custom genson class and the default genson class. Both yield the same…
K_U
  • 15,832
  • 8
  • 26
  • 29
0
votes
2 answers

process part of json file

I've got a json file that looks like this { "races": [ { "name" : "ORC" }, { "name" : "HUMAN" }, { "name" : "ELF" } ], "npc": [ { "race" : "HUMAN", "age" : "25", "name" :…
lapots
  • 12,553
  • 32
  • 121
  • 242