Object having id as key-name not getting populated via spring-data couchbase

Hi ,

I have a sample document as below which I am storing in couchbase DB.

{

"id": "036efcc9-20a2-4d4e-ade8-129df697e837",

"action": "User Action needed",

"actionType": "Auto",

"createdAt": 1599202767506,

"description": "Shipped",

"source": "Manual",

"user": {

    "id": "user_01",

    "email": "abc@gmail.com"

}

}

As above “id” is the document-id which we are auto-generating via SDK, also we have one more object in the document as user, which has id as its attribute.
The above document is getting saved via spring-data-couchbase successfully, but when we are trying to retrieve the same document via findById(String id),…(Here id is document-id) we are getting the below result:

{

"id": "036efcc9-20a2-4d4e-ade8-129df697e837",

"action": "User Action needed",

"actionType": "Auto",

"createdAt": 1599202767506,

"description": "Shipped",

"source": "Manual",

"user": {

    "id": null,

    "email": "abc@gmail.com"

}

}

findById when done then nested object having id as key-name is coming as null. Here user.id is coming as null when fetched from DB.

I am using java-sdk-3, spring version 2.3.3.RELEASE, and spring-data-couchbase as 4.0.3.RELEASE.

The issue is seen only with the latest update, previously it was working fine.

Please provide your inputs, it is because of the newer version that id has been marked as a reserved keyword and can only be used as part of document-id and not with other attribute key-name.

Thanks.

Adding some of our findings on the above issue.

Checked the below file

https://github.com/spring-projects/spring-data-couchbase/blob/4.0.x/src/main/java/org/springframework/data/couchbase/core/mapping/BasicCouchbasePersistentProperty.java

Here field which was named as id are considered as Identifiers.

Please provide your inputs.