@@ -1028,16 +1028,9 @@ public CodegenParameter fromRequestBody(RequestBody body, Set<String> imports, S
10281028 private String getIntegerDataType (String format ,
10291029 BigInteger minimum ,
10301030 boolean exclusiveMinimum ,
1031- BigInteger maximum ,
1032- boolean exclusiveMaximum ,
1033- boolean explicitUnsigned ) {
1034- boolean unsigned = explicitUnsigned || canFitIntoUnsigned (minimum , exclusiveMinimum );
1035-
1036- if (explicitUnsigned && !canFitIntoUnsigned (minimum , exclusiveMinimum )) {
1037- // Preserve explicit unsigned intent (e.g. x-unsigned) even when no lower bound is provided.
1038- minimum = BigInteger .ZERO ;
1039- exclusiveMinimum = false ;
1040- }
1031+ final BigInteger maximum ,
1032+ final boolean exclusiveMaximum ) {
1033+ final boolean unsigned = canFitIntoUnsigned (minimum , exclusiveMinimum );
10411034
10421035 if (StringUtils .isEmpty (format )) {
10431036 return bestFittingIntegerType (
@@ -1069,26 +1062,18 @@ private String getIntegerDataType(String format,
10691062 }
10701063 }
10711064
1072- private boolean hasExplicitUnsignedExtension (Map <String , Object > extensions ) {
1073- return extensions != null && Boolean .TRUE .equals (extensions .get ("x-unsigned" ));
1074- }
1075-
10761065 @ Override
10771066 public String getSchemaType (Schema p ) {
10781067 if (Objects .equals (p .getType (), "integer" )) {
1079- BigInteger minimum = Optional .ofNullable (p .getMinimum ()).map (BigDecimal ::toBigInteger ).orElse (null );
1080- BigInteger maximum = Optional .ofNullable (p .getMaximum ()).map (BigDecimal ::toBigInteger ).orElse (null );
1081- boolean explicitUnsigned = ModelUtils .isUnsignedIntegerSchema (p )
1082- || ModelUtils .isUnsignedLongSchema (p )
1083- || hasExplicitUnsignedExtension (p .getExtensions ());
1068+ final BigInteger minimum = Optional .ofNullable (p .getMinimum ()).map (BigDecimal ::toBigInteger ).orElse (null );
1069+ final BigInteger maximum = Optional .ofNullable (p .getMaximum ()).map (BigDecimal ::toBigInteger ).orElse (null );
10841070
10851071 return getIntegerDataType (
10861072 p .getFormat (),
10871073 minimum ,
10881074 Optional .ofNullable (p .getExclusiveMinimum ()).orElse (false ),
10891075 maximum ,
1090- Optional .ofNullable (p .getExclusiveMaximum ()).orElse (false ),
1091- explicitUnsigned );
1076+ Optional .ofNullable (p .getExclusiveMaximum ()).orElse (false ));
10921077 }
10931078
10941079 return super .getSchemaType (p );
@@ -1184,18 +1169,14 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert
11841169
11851170 // Integer type fitting
11861171 if (Boolean .TRUE .equals (property .isInteger ) || Boolean .TRUE .equals (property .isLong ) || Objects .equals (property .baseType , "UnsignedInteger" ) || Objects .equals (property .baseType , "UnsignedLong" )) {
1187- BigInteger minimum = Optional .ofNullable (property .getMinimum ()).map (BigInteger ::new ).orElse (null );
1188- BigInteger maximum = Optional .ofNullable (property .getMaximum ()).map (BigInteger ::new ).orElse (null );
1189- boolean explicitUnsigned = Objects .equals (property .baseType , "UnsignedInteger" )
1190- || Objects .equals (property .baseType , "UnsignedLong" )
1191- || hasExplicitUnsignedExtension (property .vendorExtensions );
1172+ final BigInteger minimum = Optional .ofNullable (property .getMinimum ()).map (BigInteger ::new ).orElse (null );
1173+ final BigInteger maximum = Optional .ofNullable (property .getMaximum ()).map (BigInteger ::new ).orElse (null );
11921174 property .dataType = getIntegerDataType (
11931175 property .dataFormat ,
11941176 minimum ,
11951177 property .getExclusiveMinimum (),
11961178 maximum ,
1197- property .getExclusiveMaximum (),
1198- explicitUnsigned );
1179+ property .getExclusiveMaximum ());
11991180 }
12001181
12011182 property .name = underscore (property .name );
0 commit comments