Good Morning, I am using Salesforce Enhanced External Services and have hit an issue with how Salesforce is interpreting the OpenAPI (Swagger File)

One of the parameters in the swagger file is a field called "time" which is a string representing a time. When i import the definition and Salesforce creates the appropriate actions and apex defined variable it renames the field from "time" to "z0time" and in turn i obviously get an error from the API due to an incorrect fieldname.

Has anyone else experienced this and have any suggestions on how i can get SF not to rename the field. Thanks

  • This is a bug in External Services, please report it to Salesforce via a case. – identigral Apr 7 at 2:40
  • Thanks i do have a case open with them as well so will see what they say. – AndrewC Apr 7 at 2:48

Salesforce is altering the name because Time is a "reserved identifier". You will necessarily need to change the API to not use the literal field value "time" in order for Apex to support this API.

| improve this answer | |
  • Thanks @sfdcfox this is an external system so to get it to work i need to ask the external vendors to potentially change their API is that correct? – AndrewC Apr 7 at 2:35
  • I have just checked this link and i cant see Time as a reserved word. developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… is there any other location i can look to see where these reserved identifiers are? – AndrewC Apr 7 at 2:58
  • @AndrewC That's the list--it's a bug in the documentation. I reported this to the documentation team. – sfdcfox Apr 7 at 3:27
  • This should now be resolved in Summer '20. – ddeve Jul 17 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.