Skip to content

Comments

fix: correct invalid JSON in Swagger UI examples for list parameters#541

Merged
awalker4 merged 1 commit intomainfrom
fix/swagger-ui-invalid-json-examples
Feb 9, 2026
Merged

fix: correct invalid JSON in Swagger UI examples for list parameters#541
awalker4 merged 1 commit intomainfrom
fix/swagger-ui-invalid-json-examples

Conversation

@awalker4
Copy link
Collaborator

@awalker4 awalker4 commented Feb 9, 2026

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


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 examples strings for languages, ocr_languages, and skip_infer_table_types to use proper JSON array syntax (double-quoted strings), preventing Swagger UI rendering errors for the /general/doc endpoint.

Written by Cursor Bugbot for commit f408553. This will update automatically on new commits. Configure here.

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>
@awalker4 awalker4 enabled auto-merge (squash) February 9, 2026 19:59
@awalker4 awalker4 requested a review from yuming-long February 9, 2026 20:00
@awalker4 awalker4 merged commit 99554f9 into main Feb 9, 2026
12 checks passed
@awalker4 awalker4 deleted the fix/swagger-ui-invalid-json-examples branch February 9, 2026 20:45
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.

Swagger UI render issue

2 participants