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
0
votes
1 answer

JAX-RS joda datetime from json

I am building an API using java and the following libraries javax.ws.rs-api-2.0.1 genson-1.4 joda-time-2.9.6 I am now trying to create a post request with a list of object as a parameter @Path("service") public class ServiceResource { …
Weedoze
  • 13,683
  • 1
  • 33
  • 63
0
votes
1 answer

Genson not consuming Hibernate POJO's field annotated with @Transient

For implementing a REST API in Java, I'm using: - Jersey JAX-RS Framework - Genson parser - Tomcat8 server - Hibernate I have this method in a service class: @POST @Consumes("application/json") public Response createUser(Users user) { UsersDAO u…
Juan
  • 1,949
  • 1
  • 15
  • 22
0
votes
0 answers

Runtime serialize condition with Genson

Is it possible with Genson to conditionally serialize an object property at runtime? In other words to include/exclude a property at runtime due to a condition? I've read of a RuntimePropertyFilter in the doc but no examples on how to use it. Thanks…
Myrdivar
  • 145
  • 2
  • 10
0
votes
0 answers

The finer points of runnable jar creation (Jersey & Genson)

I can create a runnable jar every time with Eclipse's Runnable Jar wizard. If I check the box for Eclipse to "Save as ANT script", then incorporate that code into build.xml and then have our GitLab CI process do a build & create a runnable jar, it…
Kelly Beard
  • 684
  • 1
  • 8
  • 20
0
votes
1 answer

Genson issue with android - scala.Array not found

I make an application for android using scala (macroid framework, if it matters). I get issues while deserializing JSON using Genson Library. Here is the minimal error code case class Model(a: Int, b: String) class MainActivity extends…
0
votes
1 answer

Genson chokes on a valid json output from my JAX RS service

I'm trying to deserialize a json response from my jax rs service with genson 1.3 to a list of objects which looks like…
Artem Zhirkov
  • 157
  • 12
0
votes
1 answer

Jersey/Genson: Unmarschalling single object array

Similar to Jersey: Json array with 1 element is serialized as object BUT on the client side. E.g. I recieve a JSON object where a field is an array regulary, but in case there is only one element, it is a single…
gapvision
  • 999
  • 1
  • 10
  • 30
0
votes
1 answer

JSON to object issue with Jersey and Genson

I'm running into the following problem when trying to execute a POST call using Jersey and Genson: .... com.owlike.genson.JsonBindingException: No constructor has been found for type interface Animal .... I have the following setup: ->…
xDG
  • 309
  • 6
  • 18
0
votes
1 answer

Genson not throwing UnrecognizedPropertyException

I have json POST request with the following {"token":"abcd","m":"n"} where as the java bean holds: @XmlRootElement class Token { public String token; } On using Genson, it is not throwing UnrecognizedPropertyException which otherwise happen…
gjosh
  • 135
  • 3
  • 18
0
votes
1 answer

Only add class metadata for non-concrete types in Genson

So I can do the following new GensonBuilder().useClassMetadata(true) and Genson will add a @Class element to the Json Object with the class name when it serializes. Is there any way I can have this happen only when it comes to a runtime type that is…
Cheetah
  • 13,785
  • 31
  • 106
  • 190
0
votes
1 answer

Consume REST service with generic parameter

I'm tryin to consume this REST service @POST @Path(value="/storeGeneric") @Consumes(MediaType.APPLICATION_JSON) public void storeGeneric(T data) { try { System.out.println("data name: "+data.getClass().getCanonicalName()); …
Francesco
  • 1,742
  • 5
  • 44
  • 78
0
votes
1 answer

How to map multiple sets from Hibernate class to Json?

This is a piece of class, that I've mapped into Hibernate: @OneToMany(cascade=CascadeType.ALL) @JoinColumn(name="hall_id") Set literatures; @OneToMany(cascade=CascadeType.ALL) @JoinColumn(name="hall_id") Set
e jay
  • 217
  • 1
  • 3
  • 6
0
votes
2 answers

Can Genson handle generic, nested fields on objects?

Basically I have some Java objects that I want serialized to JSON with as little headache as possible. Right now I'm using Tomcat, Jersey and Genson. I've discovered that something like this doesn't work (this is a toy example, of course) with…
Jesus is Lord
  • 14,971
  • 11
  • 66
  • 97
-1
votes
1 answer

Genson library in jersey webservices to deserialize data

I have used genson has a way to send complex data objects to jersey rest webservices in java applications. Although when i try to send floats, i get the following error: Mai 29, 2014 9:56:47 PM com.sun.jersey.spi.container.ContainerResponse…
-6
votes
2 answers

how to fix this error android: Could not find class 'com.owlike.genson.Genson'

final Collaborateur collaborateur = new Genson().deserialize(scanner.nextLine(),Collaborateur.class); 05-17 12:00:20.058: E/dalvikvm(3150): Could not find class 'com.owlike.genson.Genson', referenced from method…
tabn3adit
  • 3
  • 4
1 2 3
4