0

We replicate data from Sales Cloud V2 system to our micro service and our services bases on java. Therefore we use the SAP Cloud SDK openAPI generator, which works fine.

In Sales Cloud V2 for some entities the customer has the possibility to add extensibility fields to an entity. for instance contact. This extensibility fields are also exposed in the corresponding service and openAPI definition.

For instance when a customer has added extension fields then the schema for the contact person of the extension fields can be found underneath extensions:

        "ContactPersonqueryresponse": {
            "title": "ContactPerson query response",
            "type": "object",
            "properties": {
                "count": {
                    "type": "integer",
                    "format": "int32"
                },
                "value": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "displayId": {
                                "type": "string"
                            },
                ...
                            },
                            "extensions": {
                                "type": "object",
                                "properties": {
                                    "linkedinprofile_lf0wwm40": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "additionalacademictitle_lf8bbolv": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },

When we generate the models and api client for contact person in our java project we do not have information about the extension fields at customer site. Meaning our openAPI definition file has no fields unterneath extensions.

The issue we face is that we cannot get the extension fields and its value of our customer in Get operation.

We were not able to find documentation or hint in community to overcome the issue.

Is there a way to get extension fields, which are not part of the schema respectively generated model ?

Thanks for your help in advance.

Best Regards, Axel

asem
  • 3
  • 1

2 Answers2

0

Currently, we do not support extensibility fields in the OpenAPI client generator.

Ksivakumar
  • 188
  • 1
  • 7
  • I will create a feature request for this use case, if you would like to increase priority on this item, please reach out to our PO with your concerns, by dropping us an email at cloudsdk@sap.com. – Ksivakumar Mar 17 '23 at 08:47
0

OpenAPI generated objects can now read custom fields which are not part of the object's schema:

  • getCustomFieldNames()
  • getCustomField("nameOfField")

This feature has been added to version 4.14.0 of the SAP Cloud SDK

  • Hi, thanks for the feature. Unfortunately, they does not work for us. For instance in our model the field prefferablechannel_lfmfamtq does not exist in the model. When I do a get request of the entity via Postman then the response looks like this ` ... "extensions": { "prefferablechannel_lfmfamtq": "Z01" }, ... ` When I call the new methods in our java project for both methods nothing is returned. However, what we need is a method like getValueOfCustomField("nameOfField"). Based on the name of custom field we get back the value. – asem Jun 09 '23 at 14:03
  • Could you send the entire response and the model please? – Charles Dubois Jun 14 '23 at 06:13
  • Hi Charles, I did a retest and this time I was able to get the value of fields, which are not part of the schema. Thanks a lot for providing this feature. It is very helpful for us. Best Regards, Axel – asem Jun 28 '23 at 10:13