Skip to main content

webhook-missing-request-body-with-mapping

Overview

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

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

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

Suggested Fixes

  • Add a request body parameter to the webhook 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 webhook doesn't need a request body, remove it from the group or remove the discriminator mappings that reference it.

For More Information