Add missing code samples and remove unused ones#3545
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
📝 WalkthroughWalkthroughUpdated Meilisearch API documentation and code examples by removing outdated snippets and adding comprehensive examples for chat operations, dynamic search rules, foreign keys settings, network control, and task management across YAML configuration, OpenAPI spec, and MDX documentation files. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
4db90ec to
faf6399
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
snippets/generated-code-samples/code_samples_get_dynamic_search_rule_1.mdx (1)
7-7: Consider adding a trailing newline.The file is missing a trailing newline at the end. While not critical, adding one aligns with common convention in many codebases.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@snippets/generated-code-samples/code_samples_get_dynamic_search_rule_1.mdx` at line 7, Add a trailing newline at the end of the file to comply with POSIX and repository conventions; open the file (snippets/generated-code-samples/code_samples_get_dynamic_search_rule_1.mdx), move the cursor to the end after the closing </CodeGroup> tag and insert a single newline character so the file ends with a blank line..code-samples.meilisearch.yaml (3)
1442-1446: Align snippet key naming with POST action.
list_dynamic_search_rules_1(Line 1443) maps to# post_dynamic_search_rulesand a POST request (Line 1445). Renaming the key to a POST/create-style name would reduce confusion.Suggested diff
-# post_dynamic_search_rules -list_dynamic_search_rules_1: |- +# post_dynamic_search_rules +create_dynamic_search_rule_1: |- curl \ -X POST 'MEILISEARCH_URL/dynamic-search-rules' \ -H 'Content-Type: application/json'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.code-samples.meilisearch.yaml around lines 1442 - 1446, The snippet key name list_dynamic_search_rules_1 conflicts with the POST action and comment post_dynamic_search_rules; rename the key to reflect a POST/create operation (e.g., post_dynamic_search_rules_1 or create_dynamic_search_rules_1) so the key matches the HTTP verb and comment, and update any references to list_dynamic_search_rules_1 accordingly.
1387-1393: UseWORKSPACE_UIDplaceholder forworkspaceUidroutes.Line 1389 and Line 1393 use
WORKSPACE_NAMEeven though the route isworkspaceUid. This is easy to misread and copy incorrectly.Based on learnings: Documentation should be thorough, containing all information users need to use Meilisearch.Suggested diff
get_chat_workspace_1: |- curl \ - -X GET 'MEILISEARCH_URL/chats/WORKSPACE_NAME' + -X GET 'MEILISEARCH_URL/chats/WORKSPACE_UID' # delete_chats_workspaceUid delete_chat_workspace_1: |- curl \ - -X DELETE 'MEILISEARCH_URL/chats/WORKSPACE_NAME' + -X DELETE 'MEILISEARCH_URL/chats/WORKSPACE_UID'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.code-samples.meilisearch.yaml around lines 1387 - 1393, Replace the ambiguous WORKSPACE_NAME placeholder with WORKSPACE_UID for the workspaceUid routes so examples are accurate: update the get_chat_workspace_1 and delete_chat_workspace_1 curl examples to use 'WORKSPACE_UID' in the URL (the route expects workspaceUid). Ensure both occurrences (in the GET and DELETE examples) are changed to prevent copy-paste errors.
1457-1463: Avoid past-dated campaign timestamps in examples.As of April 6, 2026, Line 1462 uses a fixed window on November 28, 2025. A placeholder or relative/current-year example would age better.
Suggested diff
- "description": "Black Friday 2025 rules", + "description": "Black Friday campaign rules", "priority": 10, "active": true, "conditions": [ { "scope": "query", "isEmpty": true }, - { "scope": "time", "start": "2025-11-28T00:00:00Z", "end": "2025-11-28T23:59:59Z" } + { "scope": "time", "start": "YYYY-11-28T00:00:00Z", "end": "YYYY-11-28T23:59:59Z" } ],🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.code-samples.meilisearch.yaml around lines 1457 - 1463, The example uses a hard-coded past date in the rule "Black Friday 2025 rules" within the conditions time window (keys "start" and "end"); update the time values to be non-past-proof by replacing the fixed timestamps with either a template placeholder (e.g., "{{BLACK_FRIDAY_START}}"/"{{BLACK_FRIDAY_END}}") or generate them relative to the current year (use current-year November 28T00:00:00Z and November 28T23:59:59Z) so the "conditions" time window remains valid going forward.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.code-samples.meilisearch.yaml:
- Around line 1382-1393: The curl sample for the GET /chats endpoint under the
snippet key list_chat_workspaces_1 is missing the required Bearer auth header;
update the curl invocation for list_chat_workspaces_1 by adding -H
'Authorization: Bearer MEILISEARCH_KEY' (same header format used elsewhere) so
the sample matches the OpenAPI security requirement for the /chats endpoint.
---
Nitpick comments:
In @.code-samples.meilisearch.yaml:
- Around line 1442-1446: The snippet key name list_dynamic_search_rules_1
conflicts with the POST action and comment post_dynamic_search_rules; rename the
key to reflect a POST/create operation (e.g., post_dynamic_search_rules_1 or
create_dynamic_search_rules_1) so the key matches the HTTP verb and comment, and
update any references to list_dynamic_search_rules_1 accordingly.
- Around line 1387-1393: Replace the ambiguous WORKSPACE_NAME placeholder with
WORKSPACE_UID for the workspaceUid routes so examples are accurate: update the
get_chat_workspace_1 and delete_chat_workspace_1 curl examples to use
'WORKSPACE_UID' in the URL (the route expects workspaceUid). Ensure both
occurrences (in the GET and DELETE examples) are changed to prevent copy-paste
errors.
- Around line 1457-1463: The example uses a hard-coded past date in the rule
"Black Friday 2025 rules" within the conditions time window (keys "start" and
"end"); update the time values to be non-past-proof by replacing the fixed
timestamps with either a template placeholder (e.g.,
"{{BLACK_FRIDAY_START}}"/"{{BLACK_FRIDAY_END}}") or generate them relative to
the current year (use current-year November 28T00:00:00Z and November
28T23:59:59Z) so the "conditions" time window remains valid going forward.
In `@snippets/generated-code-samples/code_samples_get_dynamic_search_rule_1.mdx`:
- Line 7: Add a trailing newline at the end of the file to comply with POSIX and
repository conventions; open the file
(snippets/generated-code-samples/code_samples_get_dynamic_search_rule_1.mdx),
move the cursor to the end after the closing </CodeGroup> tag and insert a
single newline character so the file ends with a blank line.
🪄 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: 7a9611b6-e16e-48d0-8b51-06d2a83dea02
📒 Files selected for processing (25)
.code-samples.meilisearch.yamlassets/open-api/meilisearch-openapi-mintlify.jsonsnippets/generated-code-samples/code_samples_chat_index_settings_1.mdxsnippets/generated-code-samples/code_samples_compact_task_queue_1.mdxsnippets/generated-code-samples/code_samples_delete_chat_workspace_1.mdxsnippets/generated-code-samples/code_samples_delete_dynamic_search_rule_1.mdxsnippets/generated-code-samples/code_samples_field_properties_guide_searchable_1.mdxsnippets/generated-code-samples/code_samples_get_chat_workspace_1.mdxsnippets/generated-code-samples/code_samples_get_dynamic_search_rule_1.mdxsnippets/generated-code-samples/code_samples_get_foreign_keys_setting_1.mdxsnippets/generated-code-samples/code_samples_get_task_documents_1.mdxsnippets/generated-code-samples/code_samples_index_settings_tutorial_api_get_setting_1.mdxsnippets/generated-code-samples/code_samples_index_settings_tutorial_api_put_setting_1.mdxsnippets/generated-code-samples/code_samples_index_settings_tutorial_api_task_1.mdxsnippets/generated-code-samples/code_samples_list_chat_workspaces_1.mdxsnippets/generated-code-samples/code_samples_list_dynamic_search_rules_1.mdxsnippets/generated-code-samples/code_samples_multi_search_remote_federated_1.mdxsnippets/generated-code-samples/code_samples_network_control_1.mdxsnippets/generated-code-samples/code_samples_patch_dynamic_search_rule_1.mdxsnippets/generated-code-samples/code_samples_post_chat_completion_1.mdxsnippets/generated-code-samples/code_samples_rename_an_index_1.mdxsnippets/generated-code-samples/code_samples_reset_chat_workspace_settings_1.mdxsnippets/generated-code-samples/code_samples_reset_foreign_keys_setting_1.mdxsnippets/generated-code-samples/code_samples_search_parameter_guide_show_ranking_score_details_1.mdxsnippets/generated-code-samples/code_samples_update_foreign_keys_setting_1.mdx
💤 Files with no reviewable changes (8)
- snippets/generated-code-samples/code_samples_index_settings_tutorial_api_task_1.mdx
- snippets/generated-code-samples/code_samples_index_settings_tutorial_api_get_setting_1.mdx
- snippets/generated-code-samples/code_samples_rename_an_index_1.mdx
- snippets/generated-code-samples/code_samples_chat_index_settings_1.mdx
- snippets/generated-code-samples/code_samples_search_parameter_guide_show_ranking_score_details_1.mdx
- snippets/generated-code-samples/code_samples_field_properties_guide_searchable_1.mdx
- snippets/generated-code-samples/code_samples_index_settings_tutorial_api_put_setting_1.mdx
- snippets/generated-code-samples/code_samples_multi_search_remote_federated_1.mdx
Description
Only
.code-samples.meilisearch.yamlto check. All other files are generated following changes in .code-samples.meilisearch.yamlThis PR fixes CI failiing
Because of one of the CI failing, some examples in our API references are generated by Mintlify and do not have proper examples created by our teams, which is not always a good experience for our users, as you can see for Network control route
Summary by CodeRabbit
Release Notes