on ‎2018 Aug 31 8:06 PM
Hi All,
When I am trying to post a json response for occ, I am getting an additional attribute "type" getting added to the response.
{
"type": "omsReturnReplacementGroupResponseWsDTO",
"result": [
{
"errorMsg": "Successful completion",
"requestId": "",
"statusCd": "0000"
}
]
}
This happens when we do not have dto-level-mapping for the response dto.
Please suggest how and from where this attribute is getting added.
Request clarification before answering.
Hi
As you have already noticed the type attribute is added to json response if you do not have a DTO mapping defined. It will also be added for subclasses of your response and in other scenarios where marshaller does not have a full type information on the controller level (in compile time).
Similar attribute will be added to xml response. Its purpose is to allow bidirectional mapping of the response - so you could use it as web service input as well. It is automatically added by the marshaller (Ee MOXY) and there is not much you can do about it.
The only way of not seeing it is to not use generics, subclasses and java.lang.Object in your type structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.