Skip to content

Issue calling the unitofwork endpoint: "body must have required property 'data'" #3

Open

Description

@gmodica

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:

Image

However, the api-spec.yaml does not specify the same payload format:

Image

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.

Activity

  1. added a commit that references this issue on Sep 9, 2025
  2. added a commit that references this issue on Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions