From 90bfb5eb484f8789c5bfcb0d0d00a6112ee61f5c Mon Sep 17 00:00:00 2001 From: Stian Jensen Date: Tue, 2 Dec 2025 20:51:10 +0100 Subject: [PATCH] Avoid two kinds of escaping in error strings Fixes a regression from https://github.com/regulaforensics/DocumentReader-web-python-client/pull/255, where quotes in strings were escaped both with backslashes, and as html escapes. Using both is redundant, and yields a SyntaxError / warning when you try to run it on certain Python versions: > SyntaxError: invalid escape sequence '\&' --- regula/documentreader/webclient/gen/models/face_api.py | 8 ++++---- .../documentreader/webclient/gen/models/process_params.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/regula/documentreader/webclient/gen/models/face_api.py b/regula/documentreader/webclient/gen/models/face_api.py index 7864f33..9bf3669 100644 --- a/regula/documentreader/webclient/gen/models/face_api.py +++ b/regula/documentreader/webclient/gen/models/face_api.py @@ -21,13 +21,13 @@ class FaceApi(BaseModel): FaceApi """ # noqa: E501 url: SkipValidation[Optional[str]] = Field(alias="url", default=None, description="The URL of the Regula Face Web service to be used.") - mode: SkipValidation[Optional[str]] = Field(alias="mode", default=None, description="The processing mode: \"match\" or \"match+search\".") + mode: SkipValidation[Optional[str]] = Field(alias="mode", default=None, description="The processing mode: \"match\" or \"match+search\".") search: SkipValidation[Optional[FaceApiSearch]] = Field(alias="search", default=None) threshold: SkipValidation[Optional[int]] = Field(alias="threshold", default=None, description="The similarity threshold, 0-100. Above 75 means that the faces' similarity is verified, below 75 is not.") service_timeout: SkipValidation[Optional[int]] = Field(alias="serviceTimeout", default=None, description="The Regula Face Web service requests timeout, ms.") - proxy: SkipValidation[Optional[str]] = Field(alias="proxy", default=None, description="Proxy to use, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXY.html\" target=\"_blank\">cURL standard</a>.") - proxy_userpwd: SkipValidation[Optional[str]] = Field(alias="proxy_userpwd", default=None, description="Username and password to use for proxy authentication, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYUSERPWD.html\" target=\"_blank\">cURL standard</a>.") - proxy_type: SkipValidation[Optional[int]] = Field(alias="proxy_type", default=None, description="Proxy protocol type, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYTYPE.html\" target=\"_blank\">cURL standard</a>.") + proxy: SkipValidation[Optional[str]] = Field(alias="proxy", default=None, description="Proxy to use, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXY.html\" target=\"_blank\">cURL standard</a>.") + proxy_userpwd: SkipValidation[Optional[str]] = Field(alias="proxy_userpwd", default=None, description="Username and password to use for proxy authentication, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYUSERPWD.html\" target=\"_blank\">cURL standard</a>.") + proxy_type: SkipValidation[Optional[int]] = Field(alias="proxy_type", default=None, description="Proxy protocol type, should be set according to the <a href=\"https://curl.se/libcurl/c/CURLOPT_PROXYTYPE.html\" target=\"_blank\">cURL standard</a>.") child_age_threshold: SkipValidation[Optional[int]] = Field(alias="childAgeThreshold", default=None, description="The age threshold for the portrait comparison. Default: 13.") child_doc_validity_years: SkipValidation[Optional[int]] = Field(alias="childDocValidityYears", default=None, description="Estimated duration of validity for a child's passport, years. Default: 5.") __properties: ClassVar[List[str]] = ["url", "mode", "search", "threshold", "serviceTimeout", "proxy", "proxy_userpwd", "proxy_type", "childAgeThreshold", "childDocValidityYears"] diff --git a/regula/documentreader/webclient/gen/models/process_params.py b/regula/documentreader/webclient/gen/models/process_params.py index f67e339..5316190 100644 --- a/regula/documentreader/webclient/gen/models/process_params.py +++ b/regula/documentreader/webclient/gen/models/process_params.py @@ -49,7 +49,7 @@ class ProcessParams(BaseModel): scenario: SkipValidation[Scenario] = Field(alias="scenario") result_type_output: SkipValidation[Optional[List[Result]]] = Field(alias="resultTypeOutput", default=None, description="Types of results to return in response. See 'Result' enum for available options") double_page_spread: SkipValidation[Optional[bool]] = Field(alias="doublePageSpread", default=None, description="Enable this option if the image you provide contains double page spread of the passport and you want to process both pages in one go. It makes sense to use it for documents that have meaningful information on both pages, like Russian domestic passport, or some others. Disabled by default.") - generate_double_page_spread_image: SkipValidation[Optional[bool]] = Field(alias="generateDoublePageSpreadImage", default=None, description="When enabled together with \"doublePageSpread\" and there is a passport with two pages spread in the image, pages will be cropped, straightened and aligned together, as if the document was captured on a flatbed scanner. Disabled by default.") + generate_double_page_spread_image: SkipValidation[Optional[bool]] = Field(alias="generateDoublePageSpreadImage", default=None, description="When enabled together with \"doublePageSpread\" and there is a passport with two pages spread in the image, pages will be cropped, straightened and aligned together, as if the document was captured on a flatbed scanner. Disabled by default.") field_types_filter: SkipValidation[Optional[List[TextFieldType]]] = Field(alias="fieldTypesFilter", default=None, description="If a document contains Visual zone, you can set the list of field types to extract. In this case, other fields are skipped during the processing, i.e. document recognition becomes faster. This filter is not applicable to the MRZ, barcode or RFID. If the fieldTypesFilter is empty, all fields are extracted. Empty by default. If fieldTypesFilter and fieldTypesIgnoreFilter are used simultaneously, fieldTypesFilter takes priority.") field_types_ignore_filter: SkipValidation[Optional[List[TextFieldType]]] = Field(alias="fieldTypesIgnoreFilter", default=None, description="If a document contains a Visual zone, you can specify a list of field types that should be excluded from extraction. All field types listed in this array are skipped during processing, while the remaining fields are recognized. This filter is not applicable to the MRZ, barcode or RFID. If the fieldTypesIgnoreFilter is empty, all fields are extracted. Empty by default. If fieldTypesFilter and fieldTypesIgnoreFilter are used simultaneously, fieldTypesFilter takes priority.") date_format: SkipValidation[Optional[str]] = Field(alias="dateFormat", default=None, description="This option allows you to set dates format so that solution will return dates in this format. For example, if you supply 'MM/dd/yyyy', and document have printed date '09 JUL 2020' for the date os issue, you will get '07/09/2020' as a result. By default it is set to system locale default (where the service is running).")