From b604043fac966a9d4f493350eff8bc42fc0cde01 Mon Sep 17 00:00:00 2001 From: xpoinsard Date: Fri, 15 Nov 2019 15:41:30 +0100 Subject: [PATCH] Fix copy-paste issues in getExample (probably copied from getDefaultValue) The warning message was speaking of DefaultValue instead of Example. The warning message was using defaultValue instead of example. The Boolean conversion was using defaultValue instead of example. --- .../models/parameters/AbstractSerializableParameter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-models/src/main/java/io/swagger/models/parameters/AbstractSerializableParameter.java b/modules/swagger-models/src/main/java/io/swagger/models/parameters/AbstractSerializableParameter.java index 26beba92e4..e47af610d4 100644 --- a/modules/swagger-models/src/main/java/io/swagger/models/parameters/AbstractSerializableParameter.java +++ b/modules/swagger-models/src/main/java/io/swagger/models/parameters/AbstractSerializableParameter.java @@ -413,12 +413,12 @@ public Object getExample() { } else if (DecimalProperty.TYPE.equals(type)) { return Double.valueOf(example); } else if (BooleanProperty.TYPE.equals(type)) { - if ("true".equalsIgnoreCase(example) || "false".equalsIgnoreCase(defaultValue)) { + if ("true".equalsIgnoreCase(example) || "false".equalsIgnoreCase(example)) { return Boolean.valueOf(example); } } } catch (NumberFormatException e) { - LOGGER.warn(String.format("Illegal DefaultValue %s for parameter type %s", defaultValue, type), e); + LOGGER.warn(String.format("Illegal Example %s for parameter type %s", example, type), e); } return example; }