fix (接口测试): 修复请求参数数字类型转换问题
--bug=1008475 --user=赵勇 【github#8035】当接口请求中存在一个数字超出integer范围时,会被转换为字符串的形式,不支持大数 https://www.tapd.cn/55049933/s/1079557
This commit is contained in:
parent
b8237b4cbd
commit
4e384680ff
|
@ -139,7 +139,7 @@ public class JSONSchemaGenerator {
|
|||
try {
|
||||
Number value = object.get("mock").getAsJsonObject().get("mock").getAsNumber();
|
||||
if (value.toString().indexOf(".") == -1) {
|
||||
concept.put(propertyName, value.intValue());
|
||||
concept.put(propertyName, value.longValue());
|
||||
} else {
|
||||
concept.put(propertyName, value.floatValue());
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class JSONSchemaRunTest {
|
|||
if (object.has("mock") && object.get("mock").getAsJsonObject() != null && StringUtils.isNotEmpty(object.get("mock").getAsJsonObject().get("mock").getAsString())) {
|
||||
Number value = object.get("mock").getAsJsonObject().get("mock").getAsNumber();
|
||||
if (value.toString().indexOf(".") == -1) {
|
||||
concept.put(propertyName, value.intValue());
|
||||
concept.put(propertyName, value.longValue());
|
||||
} else {
|
||||
concept.put(propertyName, value.floatValue());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue