Skip to content

Commit 99554f9

Browse files
awalker4claude
andauthored
fix: correct invalid JSON in Swagger UI examples for list parameters (#541)
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 <!-- CURSOR_SUMMARY --> --- > [!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. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f408553. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b9c9323 commit 99554f9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

prepline_general/api/models/form_params.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def as_form(
5454
Form(
5555
title="OCR Languages",
5656
description="The languages present in the document, for use in partitioning and/or OCR",
57-
examples=["[eng]"],
57+
examples=['["eng"]'],
5858
),
5959
BeforeValidator(SmartValueParser[List[str]]().value_or_first_element),
6060
] = [], # noqa
@@ -63,7 +63,7 @@ def as_form(
6363
Form(
6464
title="OCR Languages",
6565
description="The languages present in the document, for use in partitioning and/or OCR",
66-
examples=["[eng]"],
66+
examples=['["eng"]'],
6767
),
6868
BeforeValidator(SmartValueParser[List[str]]().value_or_first_element),
6969
] = [],
@@ -74,7 +74,7 @@ def as_form(
7474
description=(
7575
"The document types that you want to skip table extraction with. Default: []"
7676
),
77-
examples=["['pdf', 'jpg', 'png']"],
77+
examples=['["pdf", "jpg", "png"]'],
7878
),
7979
BeforeValidator(SmartValueParser[List[str]]().value_or_first_element),
8080
] = [], # noqa

0 commit comments

Comments
 (0)