I am creating a gym application
Following Entities ClientEntity
TrainerEntity
clientController
trainerController
ClientApi
I have created a bi directional mapping b/w trainer Entity and client entity
When I do findall for client or trainer I an getting nested json as in the Client api and is same with trainer api and is giving JSON: Infinite recursion (StackOverflowError);
Here I want from client api
[
    {
        "id": 1,
        "name": "Bharath",
        "address": "#34324 Address",
        "trainerEntity": {
            "id": 1,
            "name": "Niranjan",
         }
    }
]
trainer api:
[
    {
        "id": 1,
        "name": "Niranjan",
        "clientEntity": {
            "id": 1,
            "name": "Bharath",
            "address": "#34324 Address"
         }
     }
]






 
    