From ef7ee9e15cea75f352c5560d36a42d4796018878 Mon Sep 17 00:00:00 2001 From: "Sai Ram Varma Gadiraju -X (sagadira - XORIANT SOLUTIONS PRIVATE LIMITED at Cisco)" Date: Thu, 28 May 2026 11:04:36 +0530 Subject: [PATCH] ISSDK-512: Skip pattern validation for read-only properties in Python SDK - Skip regex/pattern validation for read-only properties during deserialization - Read-only properties are server-provided values and should not be validated client-side - Fixes issue where cluster names with dots, special chars fail validation - Example: InfraBaseCluster.Name with pattern ^[a-zA-Z0-9]+[\sa-zA-Z0-9_-]{1,32}$ was rejecting valid server data like 'HX-Cluster.Domain.Local' --- .../model_templates/method_set_attribute.mustache | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache b/modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache index 539062a28519..9dfd30fae1e4 100644 --- a/modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache +++ b/modules/openapi-generator/src/main/resources/python/model_templates/method_set_attribute.mustache @@ -41,6 +41,13 @@ # check_allowed_values=false # Type validation will still be enforced regardless of this setting skip_validation = os.environ.get("check_allowed_values", "True").lower() in ("false") + + # Skip pattern/regex validation for read-only properties since they are + # server-provided values and should not be validated client-side. + # This fixes issues where server returns data that doesn't match restrictive + # patterns defined in the OpenAPI spec (e.g., cluster names with dots). + is_read_only = hasattr(self, 'read_only_vars') and name in self.read_only_vars + if not skip_validation: if (name,) in self.allowed_values: check_allowed_values( @@ -48,7 +55,8 @@ (name,), value ) - if (name,) in self.validations: + # Skip regex/pattern validation for read-only properties + if (name,) in self.validations and not is_read_only: check_validations( self.validations, (name,),