Skip to content

Commit 90bfb5e

Browse files
committed
Avoid two kinds of escaping in error strings
Fixes a regression from #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 '\&'
1 parent a7df128 commit 90bfb5e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

regula/documentreader/webclient/gen/models/face_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ class FaceApi(BaseModel):
2121
FaceApi
2222
""" # noqa: E501
2323
url: SkipValidation[Optional[str]] = Field(alias="url", default=None, description="The URL of the Regula Face Web service to be used.")
24-
mode: SkipValidation[Optional[str]] = Field(alias="mode", default=None, description="The processing mode: \"match\" or \"match+search\".")
24+
mode: SkipValidation[Optional[str]] = Field(alias="mode", default=None, description="The processing mode: \"match\" or \"match+search\".")
2525
search: SkipValidation[Optional[FaceApiSearch]] = Field(alias="search", default=None)
2626
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.")
2727
service_timeout: SkipValidation[Optional[int]] = Field(alias="serviceTimeout", default=None, description="The Regula Face Web service requests timeout, ms.")
28-
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>.")
29-
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>.")
30-
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>.")
28+
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>.")
29+
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>.")
30+
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>.")
3131
child_age_threshold: SkipValidation[Optional[int]] = Field(alias="childAgeThreshold", default=None, description="The age threshold for the portrait comparison. Default: 13.")
3232
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.")
3333
__properties: ClassVar[List[str]] = ["url", "mode", "search", "threshold", "serviceTimeout", "proxy", "proxy_userpwd", "proxy_type", "childAgeThreshold", "childDocValidityYears"]

regula/documentreader/webclient/gen/models/process_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ProcessParams(BaseModel):
4949
scenario: SkipValidation[Scenario] = Field(alias="scenario")
5050
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")
5151
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.")
52-
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.")
52+
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.")
5353
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.")
5454
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.")
5555
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).")

0 commit comments

Comments
 (0)