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

Disable GensonJaxRSFeature in resteasy web.xml #108

Open
cengizkrbck opened this issue Nov 17, 2016 · 5 comments
Open

Disable GensonJaxRSFeature in resteasy web.xml #108

cengizkrbck opened this issue Nov 17, 2016 · 5 comments

Comments

@cengizkrbck
Copy link

cengizkrbck commented Nov 17, 2016

Hi,

In documentation/Extensions/JaxRs disabling genson explained. But it is for jersey.
Is there any way to disable GensonJaxRSFeature in web.xml at resteasy application.

Our rest interface heavily depend on the Jackson, but also we need&like genson when class serialization & deserialization, so we can not remove it from dependencies.

resteasy selects a json-converter-provider from dependencies automatically.

Any help or pr really appreciated. @EugenCepoi

ps: i am also working with this but i am so newbie in resteasy&jaxrs stuff.

@EugenCepoi
Copy link
Contributor

Are you doing this?
If so in the application code you can implement getSingletons and return a set containing an instance of new GensonJaxRSFeature().disable(). Just like in the documentation.

If you have a question please first use the google group http://groups.google.com/group/genson or the gitter room https://gitter.im/owlike/genson.

@cengizkrbck
Copy link
Author

cengizkrbck commented Nov 17, 2016

Hi @EugenCepoi ,

Sorry for inconvenience about issue posting, but i think disabling support with web.xml may be good feature.

Then, I tried your suggestion;
`public class MyApplication extends javax.ws.rs.core.Application{

@Override
public Set<Object> getSingletons()
{
    Set<Object> resources = new java.util.HashSet<>();
    resources.add(new GensonJaxRSFeature().disable());
    return resources;
}

}`
and in web.xml

`init-param

        _param-name>javax.ws.rs.Application</param-name_

        _param-value>com.exchange.admin.web.services.application.MyApplication</param-value_

    _/init-param_`

It still uses genson to parse over jackson.

@EugenCepoi
Copy link
Contributor

Np. Do you have a simplified version of your web.xml? Or even better would be a mavenized example that I can run to test it.

Sent from my iPhone

On Nov 18, 2016, at 12:13 AM, cengizkrbck [email protected] wrote:

Hi Eugen,

Sorry for inconvenience about issue posting, but i think disabling support with web.xml may be good feature.

Then, I tried your suggestion;
`public class MyApplication extends javax.ws.rs.core.Application{

@OverRide
public Set getSingletons()
{
Set resources = new java.util.HashSet<>();
resources.add(new GensonJaxRSFeature().disable());
return resources;
}
}
and in web.xml

javax.ws.rs.Application
com.exchange.admin.web.services.application.MyApplication
`

It still uses genson to parse over jackson.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@cengizkrbck
Copy link
Author

Thanks @EugenCepoi , i am preparing an example code

btw, complete web.xml;

genson_web.txt

@EugenCepoi
Copy link
Contributor

I don't see anything wrong in here, a runnable example would be helpful.

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

2 participants