Skip to content

Conversation

@daniel-jonathan
Copy link
Contributor

@daniel-jonathan daniel-jonathan commented Nov 19, 2025

Fix dotnet SDK README Templates for BatchCheck Documentation

Problem

The README template for the dotnet SDK contained incorrect documentation for the BatchCheck() method:

  • Used List<ClientCheckRequest> instead of ClientBatchCheckRequest
  • Used ClientTupleKey instead of ContextualTupleKeys for contextual tuples
  • Showed response.Responses instead of response.Result
  • Missing server version requirement
  • Missing ClientBatchCheck section and table of contents entry

Solution

Updated the README templates to generate correct documentation that matches the actual batch-check implementation.

Changes

1. config/clients/dotnet/template/README_calling_api.mustache

Batch Check Section:

  • Added server version requirement: "Requires OpenFGA server version 1.8.0 or greater"
  • Changed List<ClientCheckRequest> to ClientBatchCheckRequest with Checks property
  • Changed List<ClientTupleKey> to ContextualTupleKeys with TupleKeys property
  • Changed response.Responses to response.Result
  • Added MaxBatchSize configuration example
  • Added correlation ID examples (auto-generated and custom)
  • Enhanced response example with proper structure

New Client Batch Check Section:

  • Added dedicated section for ClientBatchCheck() method
  • Shows correct usage with List<ClientCheckRequest>
  • Shows correct response property response.Responses
  • Includes guidance on when to use vs BatchCheck()

2. config/common/files/README.mustache

Table of Contents:

  • Added "Client Batch Check" entry to table of contents

Result

The generator now produces accurate documentation:

Before:

var body = new List<ClientCheckRequest>() { ... };  // Wrong for BatchCheck
var response = await fgaClient.BatchCheck(body, options);
// response.Responses = ...  // Wrong property

After:

var body = new ClientBatchCheckRequest {  // Correct
    Checks = new List<ClientBatchCheckItem>() { ... }
};
var response = await fgaClient.BatchCheck(body, options);
// response.Result = ...  // Correct property

Testing

Verified that regenerating the dotnet SDK produces correct documentation:

  • Server version requirement appears in README
  • Correct models used in examples
  • Both BatchCheck and ClientBatchCheck sections present
  • Examples compile correctly

Files Modified

  • config/clients/dotnet/template/README_calling_api.mustache
  • config/common/files/README.mustache

Impact

This ensures the generated README documentation accurately reflects the batch-check API and prevents confusion for SDK users.

Summary by CodeRabbit

  • Refactor

    • Batch check API restructured with updated request/response format, including per-item correlation IDs and enhanced error handling.
  • Documentation

    • Updated batch check documentation with new usage patterns and examples; added Client Batch Check section to navigation.

✏️ Tip: You can customize this high-level summary in your review settings.

@daniel-jonathan daniel-jonathan requested a review from a team as a code owner November 19, 2025 20:51
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The pull request refactors the batch check API from a single-request model to a server-side batch model. Updates include new public types (ClientBatchCheckRequest, ClientBatchCheckItem, ContextualTupleKeys), modified response structures with per-item correlation IDs and error payloads, addition of MaxBatchSize option, and reorganized documentation reflecting the new batch check pathway.

Changes

Cohort / File(s) Summary
dotnet BatchCheck API Documentation
config/clients/dotnet/template/README_calling_api.mustache
BatchCheck API reworked from List<ClientCheckRequest> to ClientBatchCheckRequest input and response.Result output. New types introduced: ClientBatchCheckRequest, ClientBatchCheckItem, ContextualTupleKeys, TupleKey, and extended ClientBatchCheckOptions with MaxBatchSize. Per-item responses now include CorrelationId and structured Error fields. Documentation examples and usage patterns updated to reflect server-side batch behavior and client batch check pathway.
Common README Table of Contents
config/common/files/README.mustache
"Client Batch Check" entry added to TOC under Relationship Queries, positioned between "Batch Check" and "Expand".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Documentation and template updates primarily focused on reflecting new API structure
  • Consistent refactoring pattern across examples and descriptions
  • No logic implementation changes; verification focuses on API documentation accuracy and completeness

Suggested reviewers

  • rhamzeh

Pre-merge checks and finishing touches

✅ 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 accurately describes the main change: updating README templates for correct BatchCheck documentation in the dotnet client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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
Contributor

@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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
config/clients/dotnet/template/README_calling_api.mustache (1)

490-535: Client Batch Check section correctly documents client-side batching approach.

This section appropriately distinguishes the client-side batching (ClientBatchCheck) from the server-side batching (BatchCheck), using different types and response structures. The guidance on when to use each approach is helpful.

However, the naming ClientBatchCheckClientOptions (line 497) has "Client" appearing twice, which may be confusing to developers. Consider whether a clearer name like ClientBatchCheckParallelOptions or BatchCheckClientOptions would improve readability.

If the SDK allows, consider a clearer naming pattern to distinguish the two option types:

  • Current: ClientBatchCheckOptions vs ClientBatchCheckClientOptions
  • Alternative: BatchCheckOptions vs ClientBatchCheckOptions
  • Or: ServerBatchCheckOptions vs ClientBatchCheckOptions

This is purely a naming clarity suggestion and does not affect functionality.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c3efea and 369f12c.

📒 Files selected for processing (2)
  • config/clients/dotnet/template/README_calling_api.mustache (2 hunks)
  • config/common/files/README.mustache (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
config/**/*.mustache

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Validate mustache syntax and variable references across all template files, including CHANGELOG.md.mustache

Files:

  • config/common/files/README.mustache
  • config/clients/dotnet/template/README_calling_api.mustache
config/**/*.{json,mustache}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Never hardcode API keys or credentials in configuration or template files

Files:

  • config/common/files/README.mustache
  • config/clients/dotnet/template/README_calling_api.mustache
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-and-test-java-sdk
  • GitHub Check: build-and-test-dotnet-sdk
  • GitHub Check: build-and-test-go-sdk
🔇 Additional comments (4)
config/common/files/README.mustache (1)

40-40: LGTM! TOC entry aligns with new documentation section.

The new "Client Batch Check" entry is correctly positioned between "Batch Check" and "Expand", and the anchor matches the section header added in the calling API documentation.

config/clients/dotnet/template/README_calling_api.mustache (3)

397-448: BatchCheck example correctly demonstrates new server-side batch API.

The example properly uses the new types (ClientBatchCheckRequest, ClientBatchCheckItem, ContextualTupleKeys) and demonstrates both auto-generated and custom correlation IDs. The structure with ContextualTupleKeys.TupleKeys correctly addresses the issues mentioned in the PR description.


450-488: Response example accurately reflects new API structure.

The response example correctly uses response.Result (instead of response.Responses) and demonstrates the full response structure including auto-generated and custom correlation IDs, error handling, and contextual tuples placeholders.


384-394: Mustache variables verified and properly defined.

All three mustache variables used in this section are correctly defined in config/common/config.base.json with sensible defaults. Mustache syntax is valid, sections are balanced, and no hardcoded credentials are present. The code changes comply with all applicable coding guidelines.

…tion

The README template had incorrect examples for the BatchCheck method that
didn't match the actual implementation.

Changes:
- Fix BatchCheck example to use ClientBatchCheckRequest instead of List<ClientCheckRequest>
- Fix contextual tuples to use ContextualTupleKeys instead of ClientTupleKey
- Fix response property from Responses to Result
- Add server version requirement (OpenFGA v1.8.0+) with link
- Add ClientBatchCheck section for client-side parallel checking
- Add Client Batch Check to table of contents
- Add MaxBatchSize configuration example
- Add correlation ID examples (auto-generated and custom)

The templates now generate accurate documentation that matches the
actual batch-check API implementation.
@SoulPancake SoulPancake added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit 6ab8036 Dec 2, 2025
14 of 15 checks passed
@SoulPancake SoulPancake deleted the feat/batch_check branch December 2, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants