Skip to content

Integrate render route#3602

Open
dureuill wants to merge 3 commits into
mainfrom
add-render-template-route
Open

Integrate render route#3602
dureuill wants to merge 3 commits into
mainfrom
add-render-template-route

Conversation

@dureuill

@dureuill dureuill commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
  • Add POST /render-template to navigation (in Management > Template)
  • Add paragraph about testing templates to template best practices
  • Add code sample

Documentation for POST /render-template endpoint

This pull request adds comprehensive documentation for the new POST /render-template endpoint across three areas:

Navigation Structure

  • Added a new "Template" section under Management in the reference navigation
  • Includes a link to the POST /render-template endpoint documentation

Best Practices Guide

  • Integrated a new "Test your template" section in the document template best practices documentation
  • Provides guidance on using the POST /render-template route to preview template rendering
  • Includes examples of testing templates with inline documents and registered document templates
  • Demonstrates error handling scenarios, including how template rendering errors are returned

Code Sample

  • Added a new post_render_template_1 example in the code samples configuration
  • Demonstrates a curl request to POST /render-template with:
    • An inline document template using Liquid expressions
    • Sample inline document data
    • Example rendering output

@dureuill dureuill requested a review from a team as a code owner June 19, 2026 14:39
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds documentation for the POST /render-template API endpoint: a curl code sample, a new "Template" navigation group in the Management section, and a "Test your template" subsection in the hybrid search document template best practices guide covering inline templates, registered embedder templates, and error handling.

Changes

POST /render-template Documentation

Layer / File(s) Summary
Code sample and navigation entry
.code-samples.meilisearch.yaml, config/navigation.json
Adds the post_render_template_1 curl snippet demonstrating a POST /render-template request with an inline document template and inline input. Registers a new "Template" navigation group under "Management" linking to the POST /render-template page.
"Test your template" section in best practices guide
capabilities/hybrid_search/advanced/document_template_best_practices.mdx
Adds a new subsection introducing POST /render-template as a way to preview template rendering. Documents two call patterns: an inlineDocumentTemplate with Liquid truncation against an indexDocument, and a registered documentTemplate (by embedder and indexUid) against an inlineDocument. Adds an error-handling example showing the template_rendering_error response when a template references a non-existent field.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop, a new route appears,
POST /render-template the doc declares!
Liquid templates swirl and truncate with flair,
Inline or registered — both rendered with care.
If a field goes missing, an error is shown,
The bunny tested each template — now fully known! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title "Integrate render route" directly relates to the main change: adding documentation for the POST /render-template endpoint across navigation, code samples, and best practices.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-render-template-route

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.

@dureuill dureuill requested review from CaroFG and qdequele June 19, 2026 14:39
@mintlify

mintlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
meilisearch-documentation 🔴 Failed Jun 19, 2026, 2:39 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@capabilities/hybrid_search/advanced/document_template_best_practices.mdx`:
- Around line 52-64: The curl command examples in the
document_template_best_practices.mdx file are incorrectly fenced with json code
blocks instead of bash code blocks. Change the code fence markers from json to
bash for all three curl command examples located at lines 52-64, 88-103, and
126-137 to make the samples clear and properly runnable according to coding
guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73a29d88-b51f-4d88-b0f5-914eb781a06d

📥 Commits

Reviewing files that changed from the base of the PR and between 2de0813 and c2f1ba1.

📒 Files selected for processing (3)
  • .code-samples.meilisearch.yaml
  • capabilities/hybrid_search/advanced/document_template_best_practices.mdx
  • config/navigation.json

Comment on lines +52 to +64
```json
curl -X POST $MEILISEARCH_URL/render-template --json '{
"template": {
"kind": "inlineDocumentTemplate",
"inline": "A movie called {{doc.title}} whose description starts with: {{doc.overview|truncatewords:10}}"
},
"input": {
"kind": "indexDocument",
"indexUid": "movies",
"id": "2"
}
}
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use shell code fences for curl examples

Lines 52, 88, and 126 contain curl commands but are fenced as json. Switch those blocks to bash (or sh) so samples stay clear and runnable.

Suggested diff
-```json
+```bash
 curl -X POST $MEILISEARCH_URL/render-template --json '{
   "template": {
     "kind": "inlineDocumentTemplate",
     "inline": "A movie called {{doc.title}} whose description starts with: {{doc.overview|truncatewords:10}}"
@@
 }'

-json +bash
curl -X POST $MEILISEARCH_URL/render-template --json '{
"template": {
"kind": "documentTemplate",
@@
}'


-```json
- curl -X POST $MEILISEARCH_URL/render-template --json '{
+```bash
+curl -X POST $MEILISEARCH_URL/render-template --json '{
  "template": {
    "kind": "inlineDocumentTemplate",
    "inline": "A buggy template that refers to an unavailable field: {{doc.doesnotexist}}"

As per coding guidelines, "Keep code samples minimal and runnable; they should illustrate the concept, not add noise."

Also applies to: 88-103, 126-137

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@capabilities/hybrid_search/advanced/document_template_best_practices.mdx`
around lines 52 - 64, The curl command examples in the
document_template_best_practices.mdx file are incorrectly fenced with json code
blocks instead of bash code blocks. Change the code fence markers from json to
bash for all three curl command examples located at lines 52-64, 88-103, and
126-137 to make the samples clear and properly runnable according to coding
guidelines.

Source: Coding guidelines

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.

1 participant