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.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Callback assigned to group with discriminator mappings but lacks request body parameter. |
| Code | APIMATICCODEGEN_V549 |
| 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 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.Bodyformat. - 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.