Setup One-to-one relation between two doctypes

I have a frontend running on React and using Frappe REST APIs.

Requirements:

  1. Basically, I need to link two models, One is Client and the other one is Client Address. A client can only have one client address associated and the same vice versa.
  2. When I fetch a client doc, the response should be
{
    "data": {
        "name": "...",
        "address": {
            "line_1": "...",
            "line_2": "...",
            "zip": "..."
        },
        ...
    }
}

instead of (this is what I’m getting now when I use Link field type)

{
    "data": {
        "name": "...",
        "address": "1ef2a7c80e",
        ...
    }
}

Here are the client doctype fields:

That’s it.

As I could not find the solution in the documentation, please guide me if I’m doing something wrong. I’m new to Frappe.

@ayandebnath you have many solutions.
you can use another api call to fetch address details.
you can create your own api function to return the data you need .
you can add custom fields in client doctype to stock the address details and they will appear in your api return.

I understand the first and second solutions.
Can you explain the third one?

PS: I prefer the address object inside the client object {..., "address": {...}} so that I can update everything in a single API call if possible.

@ayandebnath ok now when you said update, you can no longer use the third option.