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.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Webhook assigned to group with discriminator mappings but lacks request body parameter. |
Code | APIMATICCODEGEN_V550 |
Type | Validation |
Rule System | Semantic |
Broad Category | Webhooks |
Products Impacted | Code Generation, Developer Experience Portal |
Tags | apimatic 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.