You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to do all the required configuration for an objectMapper to be used by katharsis. Registering the JsonModule would be an example. We are using katharsis as a filter (AbstractKatharsisFilter).
Here's the problem: when I pass a preconfigured objectMapper to KatharsisInvokerBuilder.objectMapper(...) then it will not be configured by katharsis to use katharsis' serializers, basically bypassing all of katharsis serialization functionality.
If I don't pass an objectMapper to this builder method, then katharsis will create a new, properly configured objectMapper, but it will be inaccessible to me for further configuration.
For now, I ended up extending KatharsisInvokerBuilder (which basically copies all code of super class) and also configure a passed objectMapper bean (spring managed).
This is an excerpt of the build() method:
@Override
public KatharsisInvoker build() throws Exception
{
// ... all stuff above
if (objectMapper == null)
{
objectMapper = createObjectMapper(resourceRegistry);
} else
{
// that's the important thing to do!
objectMapper.registerModule(createDataBindingModule(resourceRegistry));
}
// more stuff
return new KatharsisInvoker(objectMapper, queryParamsBuilder, resourceRegistry,
requestDispatcher);
}
This allows me to inject a properly configured objectMapper whenever I need do (de)serialize stuff.
Btw, I do miss javadoc direly.
Talking about javadoc, this documentation seems wrong:
/**
* Set prefix to be searched when performing method matching and building building <i>links</i> objects in responses. The name of the configuration property is <tt>{@value}</tt>.
*/
public static final String WEB_PATH_PREFIX = "katharsis.config.web.path.prefix";
The specified prefix is NOT included in the created links. Link only uses defaultDomain plus resource type for the link. I think the docu should stick and the implementation should do what the javadoc says. Makes sense to me.
Thanks!
Copied from original issue: katharsis-project/katharsis-servlet#24
The text was updated successfully, but these errors were encountered:
From @weaselmetal on May 19, 2016 14:27
I was trying to do all the required configuration for an objectMapper to be used by katharsis. Registering the JsonModule would be an example. We are using katharsis as a filter (AbstractKatharsisFilter).
Here's the problem: when I pass a preconfigured objectMapper to
KatharsisInvokerBuilder.objectMapper(...)
then it will not be configured by katharsis to use katharsis' serializers, basically bypassing all of katharsis serialization functionality.If I don't pass an objectMapper to this builder method, then katharsis will create a new, properly configured objectMapper, but it will be inaccessible to me for further configuration.
For now, I ended up extending KatharsisInvokerBuilder (which basically copies all code of super class) and also configure a passed objectMapper bean (spring managed).
This is an excerpt of the build() method:
This allows me to inject a properly configured objectMapper whenever I need do (de)serialize stuff.
Btw, I do miss javadoc direly.
Talking about javadoc, this documentation seems wrong:
The specified prefix is NOT included in the created links. Link only uses defaultDomain plus resource type for the link. I think the docu should stick and the implementation should do what the javadoc says. Makes sense to me.
Thanks!
Copied from original issue: katharsis-project/katharsis-servlet#24
The text was updated successfully, but these errors were encountered: