fix: correct invalid JSON in Swagger UI examples for list parameters#541
Merged
fix: correct invalid JSON in Swagger UI examples for list parameters#541
Conversation
The examples for languages, ocr_languages, and skip_infer_table_types parameters were using invalid JSON syntax (e.g., "[eng]" instead of '["eng"]'). This caused Swagger UI to fail rendering the /general/doc endpoint with the error: "Unexpected token 'e', \"[eng]\" is not valid JSON" Changed: - languages: "[eng]" -> '["eng"]' - ocr_languages: "[eng]" -> '["eng"]' - skip_infer_table_types: "['pdf', 'jpg', 'png']" -> '["pdf", "jpg", "png"]' These parameters use multipart/form-data which requires stringified JSON for array values. The fix uses proper JSON syntax with double quotes, matching the pattern used elsewhere (e.g., extract_image_block_types). Fixes #537 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
yuming-long
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The examples for languages, ocr_languages, and skip_infer_table_types parameters were using invalid JSON syntax (e.g., "[eng]" instead of '["eng"]'). This caused Swagger UI to fail rendering the /general/doc endpoint with the error: "Unexpected token 'e', "[eng]" is not valid JSON"
Changed:
These parameters use multipart/form-data which requires stringified JSON for array values. The fix uses proper JSON syntax with double quotes, matching the pattern used elsewhere (e.g., extract_image_block_types).
Fixes #537
Note
Low Risk
Doc/Swagger example-only updates to form parameter metadata; no runtime logic or request parsing changes.
Overview
Fixes invalid JSON shown in Swagger UI examples for multipart/form-data list parameters in
GeneralFormParams.as_form.Updates the
examplesstrings forlanguages,ocr_languages, andskip_infer_table_typesto use proper JSON array syntax (double-quoted strings), preventing Swagger UI rendering errors for the/general/docendpoint.Written by Cursor Bugbot for commit f408553. This will update automatically on new commits. Configure here.