Skip to content

Add callouts API documentation#7

Open
ray-idempiere wants to merge 3 commits intobxservice:mainfrom
ray-idempiere:main
Open

Add callouts API documentation#7
ray-idempiere wants to merge 3 commits intobxservice:mainfrom
ray-idempiere:main

Conversation

@ray-idempiere
Copy link
Copy Markdown

@ray-idempiere ray-idempiere commented Feb 27, 2026

Summary

  • Add documentation for the new POST /api/v1/callout/{windowSlug}/{tabSlug} endpoint
  • Cover request/response format, parameters, error codes, and how it works internally
  • Document the hasCallout boolean flag on field metadata endpoint

Related PR: bxservice/idempiere-rest#479

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Callouts API documentation covering endpoint usage, request/response formats, and error responses.
    • Clarified how field-level callouts operate during evaluation (non-persistent execution) and included examples of input/output expectations.
    • Documented Field Metadata support with a hasCallout indicator to identify fields that trigger registered callouts.

Document the POST /api/v1/callout/{windowSlug}/{tabSlug} endpoint
for executing field-level callouts without saving, and the hasCallout
flag on field metadata.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 27, 2026

Warning

Rate limit exceeded

@ray-idempiere has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 2 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 46e558a and c24dc9a.

📒 Files selected for processing (1)
  • docs/api-guides/callouts.md

Walkthrough

Adds 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 changedFields), error responses, control flow for initializing/loading record context and snapshot comparison, and a hasCallout field metadata flag.

Changes

Cohort / File(s) Summary
Callouts API Documentation
docs/api-guides/callouts.md
Adds comprehensive docs for the Callouts API: endpoint HTTP method and URL, path parameters, request body, response format (including changedFields and trigger-column exclusion), error responses/status codes, control flow (resolve window/tab, init/load record, apply values, pre-change snapshot, trigger callouts, compare snapshots, discard record), and Field Metadata hasCallout flag description.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately summarizes the main change: adding documentation for the callouts API.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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: Clarify 400 validation text for value to avoid contradicting null support.

value is documented as required but null is also valid (Line 39). Current wording can imply null is 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.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe3c6a1 and 596cccc.

📒 Files selected for processing (1)
  • docs/api-guides/callouts.md

Clarify 400 error description to note that null is a valid value,
and use clearer wording for Window fields metadata endpoint.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 a json fenced 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.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 596cccc and 46e558a.

📒 Files selected for processing (1)
  • docs/api-guides/callouts.md

Clarify full endpoint path, tighten wording, and fix invalid JSON
in example block.
@ray-idempiere
Copy link
Copy Markdown
Author

All CodeRabbit review feedback has been addressed. This PR is ready to merge. Could someone with merge permissions please merge this? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant