Add callouts API documentation#7
Conversation
Document the POST /api/v1/callout/{windowSlug}/{tabSlug} endpoint
for executing field-level callouts without saving, and the hasCallout
flag on field metadata.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds documentation for a new Callouts API endpoint that executes field-level callouts without persisting data. Describes HTTP method/URL, path parameters, request/response schema (including Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
docs/api-guides/callouts.md (2)
94-94: Small wording tweak: “windows” is ambiguous here.Consider using “Window endpoint” (or “window metadata endpoint”) for clearer product-entity naming.
Suggested doc tweak
-The fields metadata endpoint on windows also includes a `hasCallout` boolean flag for each field: +The Window fields metadata endpoint also includes a `hasCallout` boolean flag for each field:🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-guides/callouts.md` at line 94, Replace the ambiguous word "windows" in the sentence "The fields metadata endpoint on windows also includes a `hasCallout` boolean flag for each field:" with a clearer product-entity name such as "Window endpoint" or "window metadata endpoint" so it reads e.g. "The fields metadata endpoint on the Window endpoint also includes a `hasCallout` boolean flag for each field:" or better "The window metadata endpoint's fields also include a `hasCallout` boolean flag for each field:"; update the sentence where it appears in docs/api-guides/callouts.md to use this clarified wording.
65-65: Clarify400validation text forvalueto avoid contradictingnullsupport.
valueis documented as required butnullis also valid (Line 39). Current wording can implynullis invalid.Suggested doc tweak
-| 400 | Missing or invalid `columnName`, `value`, `record`, or `recordId` | +| 400 | Missing `columnName`; malformed `record`/`recordId`; or invalid `value` type for the target column (`null` is allowed to clear) |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-guides/callouts.md` at line 65, Update the "400" table row text so it no longer implies that null is invalid for the value field—adjust the description for the 400 error (the table row beginning with "| 400 |") to state that the error is returned for missing or invalid columnName, record, recordId, or value (except when value is explicitly allowed to be null), or rephrase to "Missing or invalid `columnName`, `record`, `recordId`, or `value` (null is allowed where documented)"; ensure the `value` term in the row matches the documentation that null is a valid value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/api-guides/callouts.md`:
- Line 94: Replace the ambiguous word "windows" in the sentence "The fields
metadata endpoint on windows also includes a `hasCallout` boolean flag for each
field:" with a clearer product-entity name such as "Window endpoint" or "window
metadata endpoint" so it reads e.g. "The fields metadata endpoint on the Window
endpoint also includes a `hasCallout` boolean flag for each field:" or better
"The window metadata endpoint's fields also include a `hasCallout` boolean flag
for each field:"; update the sentence where it appears in
docs/api-guides/callouts.md to use this clarified wording.
- Line 65: Update the "400" table row text so it no longer implies that null is
invalid for the value field—adjust the description for the 400 error (the table
row beginning with "| 400 |") to state that the error is returned for missing or
invalid columnName, record, recordId, or value (except when value is explicitly
allowed to be null), or rephrase to "Missing or invalid `columnName`, `record`,
`recordId`, or `value` (null is allowed where documented)"; ensure the `value`
term in the row matches the documentation that null is a valid value.
Clarify 400 error description to note that null is a valid value, and use clearer wording for Window fields metadata endpoint.
There was a problem hiding this comment.
🧹 Nitpick comments (3)
docs/api-guides/callouts.md (3)
7-7: Clarify base path vs concrete endpoint.This line references
/api/v1/callout, while the actual callable route includes{windowSlug}/{tabSlug}. Consider explicitly saying “base path” or using the full route here to avoid ambiguity.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-guides/callouts.md` at line 7, The docs line currently names the concrete endpoint `/api/v1/callout` but the actual callable route requires window and tab segments; update the sentence in docs/api-guides/callouts.md to clarify that `/api/v1/callout` is the base path or replace it with the full route including `{windowSlug}/{tabSlug}` (e.g., `/api/v1/callout/{windowSlug}/{tabSlug}`) so readers know the required path structure.
83-83: Optional wording tighten.“Otherwise, a new record context is initialized” can be shortened for readability (e.g., “Otherwise, a new record is initialized”).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-guides/callouts.md` at line 83, Update the wording in the sentence that currently reads "If `recordId` is provided and greater than 0, the existing record is loaded. Otherwise, a new record context is initialized." — replace "a new record context is initialized" with "a new record is initialized" so the sentence reads: "If `recordId` is provided and greater than 0, the existing record is loaded. Otherwise, a new record is initialized."
98-104: Avoid invalid JSON in example block.Using
...inside ajsonfenced block makes the sample non-parseable for copy/paste users. Prefer either a complete minimal JSON object or switch to prose outside the block to indicate omitted fields.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api-guides/callouts.md` around lines 98 - 104, The JSON example in docs/api-guides/callouts.md contains an invalid placeholder ("...") inside a ```json fenced block; replace the block with a minimal, valid JSON object (e.g., include required example keys such as "columnName": "M_Product_ID" and "hasCallout": true and any other minimal fields) or convert the fenced block to prose explaining omitted fields; ensure the final fenced block is parseable JSON and references the same keys ("columnName", "hasCallout") so examples remain illustrative.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/api-guides/callouts.md`:
- Line 7: The docs line currently names the concrete endpoint `/api/v1/callout`
but the actual callable route requires window and tab segments; update the
sentence in docs/api-guides/callouts.md to clarify that `/api/v1/callout` is the
base path or replace it with the full route including `{windowSlug}/{tabSlug}`
(e.g., `/api/v1/callout/{windowSlug}/{tabSlug}`) so readers know the required
path structure.
- Line 83: Update the wording in the sentence that currently reads "If
`recordId` is provided and greater than 0, the existing record is loaded.
Otherwise, a new record context is initialized." — replace "a new record context
is initialized" with "a new record is initialized" so the sentence reads: "If
`recordId` is provided and greater than 0, the existing record is loaded.
Otherwise, a new record is initialized."
- Around line 98-104: The JSON example in docs/api-guides/callouts.md contains
an invalid placeholder ("...") inside a ```json fenced block; replace the block
with a minimal, valid JSON object (e.g., include required example keys such as
"columnName": "M_Product_ID" and "hasCallout": true and any other minimal
fields) or convert the fenced block to prose explaining omitted fields; ensure
the final fenced block is parseable JSON and references the same keys
("columnName", "hasCallout") so examples remain illustrative.
Clarify full endpoint path, tighten wording, and fix invalid JSON in example block.
|
All CodeRabbit review feedback has been addressed. This PR is ready to merge. Could someone with merge permissions please merge this? Thank you! |
Summary
POST /api/v1/callout/{windowSlug}/{tabSlug}endpointhasCalloutboolean flag on field metadata endpointRelated PR: bxservice/idempiere-rest#479
Summary by CodeRabbit