Click here to Skip to main content
15,881,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all, suppose I have a json like this , when I am send request to the server, where I am using RestTemplate generate to do this. When I send success request I am getting sucess response like this.


Java
{
    "code": 0,
    "message": "Successfully processed",
 "result": {
        "ContractRs": {
            "Contract": {
                "OrderDprt": "",
                "ClientType": "",
                "ClientCategory": "",

 }
}


but When I send failed request, I am getting response like this:

{
"code": -2000,
"message": "Policy Error"
}

What annotation do I am using to do this soliton in spring boot project using Jackson library?

What I have tried:

I think @JsonIgnoreProperties to solve this problem, but I do not know how to do this?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900