Skip to Content
2
Former Member
Mar 05, 2015 at 08:58 AM

commercewebservices/REST API (v2): customize serialized output

791 Views

Hi,

I'm using OCC (REST API v2) and try to rename instances of serialized *WsDTO objects in JSON/XML responses. In the wiki I found hints for doing that in v1 of API which is using XStream library: https://wiki.hybris.com/display/release5/Customizing+the+Commerce+Web+Services (e.g. TypeAliasMapping)

API v2 seems to apply JAX instead of XStream library. Are there any examples how to rename particular types in this version? For example I have a TestWsDTO and I would like to rename the root element of the XML response from "Test" to another name. Also I would like to configure for particular collections to be implicit or not as it is done in API v1 via xstream-converters-spring.xml. What is the way to do that in v2?

Regards,

Oliver