From f436f0eee2f46f9745d91ac057d7be47020fc11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 6 Sep 2016 14:49:00 +0300 Subject: [PATCH] python: Fix model maxLength validation error message --- .../swagger-codegen/src/main/resources/python/model.mustache | 2 +- .../client/petstore/python/petstore_api/models/format_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index 9b51612a8a5..3f5c717b0ec 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -74,7 +74,7 @@ class {{classname}}(object): raise ValueError("Invalid value for `{{name}}`, must not be `None`") {{#maxLength}} if len({{name}}) > {{maxLength}}: - raise ValueError("Invalid value for `{{name}}`, length must be less than `{{maxLength}}`") + raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") {{/maxLength}} {{#minLength}} if len({{name}}) < {{minLength}}: diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index bbc14daa13c..d36ba498de6 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -428,7 +428,7 @@ class FormatTest(object): if not password: raise ValueError("Invalid value for `password`, must not be `None`") if len(password) > 64: - raise ValueError("Invalid value for `password`, length must be less than `64`") + raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") if len(password) < 10: raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`")