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

Use grails.converters.JSON instead of gson in JsonMapType ? #81

Open
ph4t opened this issue Dec 15, 2015 · 5 comments
Open

Use grails.converters.JSON instead of gson in JsonMapType ? #81

ph4t opened this issue Dec 15, 2015 · 5 comments

Comments

@ph4t
Copy link

ph4t commented Dec 15, 2015

Hi,

In our application we are using builtin JSON class to marshall/umarshall domain classes etc. We have a lot of custom object marshallers and we are using a few plugins that integrate with Grails JSON class (https://github.com/pedjak/grails-marshallers & https://github.com/gpc/joda-time)

I would assume that most people are using the builtin JSON class as well. So, it makes more sense if JsonMapType is using class JSON instead of gson.
What is the reasoning behind using gson? Are there any issues with builtin JSON?

@ilopmar
Copy link
Collaborator

ilopmar commented Dec 15, 2015

Hi @ph4t.

I don't remember why we chose Gson instead of grails.converters.JSON. Maybe we had some problems with the Grails converters, but I can't remember at this moment.

Are you using Grails 2 or Grails 3? I could do some tests with the Grails converter to see what happen. Or maybe you can try to change it and submit a PR.

@ph4t
Copy link
Author

ph4t commented Dec 15, 2015

I'm using Grails 2.0. We won't migrate to grails 3 anytime soon.

I'll try it and submit PR

@ilopmar
Copy link
Collaborator

ilopmar commented Dec 15, 2015

If you're still using Hibernate 3 you should branch from this: https://github.com/kaleidos/grails-postgresql-extensions/tree/3.x

Please take notice that we currently are not planning to add new functionality to Hibernate 3 support (old versions of Grails). If you need new features you should think about moving to Hibernate 4 (still with Grails 2.x) and use the branch https://github.com/kaleidos/grails-postgresql-extensions/tree/grails-2.x

@ph4t
Copy link
Author

ph4t commented Dec 15, 2015

We are on hibernate 4. Thanks for letting me know which branch to use...

@kyledobitz
Copy link

Related to this, when I include the plugin with a brand new grails 3.3 project that utilizes JsonMapType it fails to start with error:
java.lang.NoClassDefFoundError: Lcom/google/gson/Gson;

Seems to be referenced/imported here:

But not included in build.gradle as a dependency

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

3 participants