Skip to main content

callback-missing-request-body-with-mapping

Overview

This rule belongs to the apimatic-codegen-validation ruleset and states that:

This callback is assigned to a callback group that has discriminator mappings, but the callback itself doesn't have a request body parameter. Since discriminator functionality relies on request body content for event type determination, the callback can't be removed without breaking the discriminator mappings.

PropertyValue
EnabledYes
Maximum SeverityError
MessageCallback assigned to group with discriminator mappings but lacks request body parameter.
CodeAPIMATICCODEGEN_V549
TypeValidation
Rule SystemSemantic
Broad CategoryWebhooks
Products ImpactedCode Generation, Developer Experience Portal
Tagsapimatic code generation codegen sdks portal docs validation apimatic callback request body discriminator mapping group assignment parameter validation

Suggested Fixes

  • Add a request body parameter to the callback definition.
  • Ensure the request body parameter has ParamFormat.Body format.
  • Define an appropriate schema for the request body that contains the discriminator field.
  • If the callback doesn't need a request body, remove it from the group or remove the discriminator mappings that reference it.

For More Information