When following the Getting Started guide, in the step where we call the Heroku API from APEX, when we execute the unitofwork call we get the following error:
InvokeHerokuAPI.postUnitOfWork();
FAILED!: 400 {"statusCode":400,"code":"FST_ERR_VALIDATION","error":"Bad Request","message":"body must have required property 'data'"}
The problem is that the index.js that handles the route for unitofwork is expecting the payload to have a "data" node:
However, the api-spec.yaml does not specify the same payload format:
Since dynamic Apex classes are based on the api-spec.yaml definition, there's no "data" attribute on the HerokuAPI_UnitOfWork_IN_body class.
Either the api-spec.yaml or the route logic in index.js needs to be modified to use the same payload definition. I suspect that it would be easier to modify the logic in index.js since all other modifications would require changing the Apex code in the Getting Started guide.
When following the Getting Started guide, in the step where we call the Heroku API from APEX, when we execute the unitofwork call we get the following error:
The problem is that the index.js that handles the route for unitofwork is expecting the payload to have a "data" node:
However, the api-spec.yaml does not specify the same payload format:
Since dynamic Apex classes are based on the api-spec.yaml definition, there's no "data" attribute on the HerokuAPI_UnitOfWork_IN_body class.
Either the api-spec.yaml or the route logic in index.js needs to be modified to use the same payload definition. I suspect that it would be easier to modify the logic in index.js since all other modifications would require changing the Apex code in the Getting Started guide.