Skip to content

Commit 6547ad5

Browse files
committed
removed pattern validation for query or path params
1 parent 336eb12 commit 6547ad5

1 file changed

Lines changed: 1 addition & 20 deletions

File tree

generator/cybersource-python-template/api.mustache

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -141,26 +141,7 @@ class {{classname}}(object):
141141
{{/allParams}}
142142

143143
{{#allParams}}
144-
{{#hasValidation}}
145-
{{#pattern}}
146-
if '{{paramName}}' in params and not re.search('{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}):
147-
if self.api_client.mconfig.log_config.enable_log:
148-
self.logger.error("InvalidArgumentException : Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`")
149-
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`")
150-
{{/pattern}}
151-
{{#maxItems}}
152-
if '{{paramName}}' in params and len(params['{{paramName}}']) > {{maxItems}}:
153-
if self.api_client.mconfig.log_config.enable_log:
154-
self.logger.error("InvalidArgumentException : Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`")
155-
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`")
156-
{{/maxItems}}
157-
{{#minItems}}
158-
if '{{paramName}}' in params and len(params['{{paramName}}']) < {{minItems}}:
159-
if self.api_client.mconfig.log_config.enable_log:
160-
self.logger.error("InvalidArgumentException : Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`")
161-
raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`")
162-
{{/minItems}}
163-
{{/hasValidation}}
144+
164145
{{#-last}}
165146

166147
{{/-last}}

0 commit comments

Comments
 (0)