From f408553c3a18b039b487e72eb9c7b01c726e6ff7 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Mon, 9 Feb 2026 14:43:22 -0500 Subject: [PATCH] fix: correct invalid JSON in Swagger UI examples for list parameters 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 --- prepline_general/api/models/form_params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prepline_general/api/models/form_params.py b/prepline_general/api/models/form_params.py index 2809c0a84..8b96bfda2 100644 --- a/prepline_general/api/models/form_params.py +++ b/prepline_general/api/models/form_params.py @@ -54,7 +54,7 @@ def as_form( Form( title="OCR Languages", description="The languages present in the document, for use in partitioning and/or OCR", - examples=["[eng]"], + examples=['["eng"]'], ), BeforeValidator(SmartValueParser[List[str]]().value_or_first_element), ] = [], # noqa @@ -63,7 +63,7 @@ def as_form( Form( title="OCR Languages", description="The languages present in the document, for use in partitioning and/or OCR", - examples=["[eng]"], + examples=['["eng"]'], ), BeforeValidator(SmartValueParser[List[str]]().value_or_first_element), ] = [], @@ -74,7 +74,7 @@ def as_form( description=( "The document types that you want to skip table extraction with. Default: []" ), - examples=["['pdf', 'jpg', 'png']"], + examples=['["pdf", "jpg", "png"]'], ), BeforeValidator(SmartValueParser[List[str]]().value_or_first_element), ] = [], # noqa