You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让StimulDesigner识别JSON模型中的所有数据类型?

在StimulDesigner中让JSON对象模型正确识别数据类型的方法

在StimulDesigner中使用Object Models配置报表属性时,常会遇到数据类型识别异常——所有属性都被判定为string类型。即便为模型的所有键设置了对应值,也仅有少数类型能被正确识别,其余仍会被当作字符串处理。

问题示例(所有属性被识别为string)

"CesCaspianModelsOutputTestPackageActivitiesActivity": {
    "Name": "",
    "Code": "",
    "Id": "",
    "RowVersion": "",
    "IsPinned": ""
}

正确的JSON格式(支持多数据类型识别)

要让StimulDesigner准确识别各数据类型,需为每个属性设置对应类型的标准格式值:

{
  "Prop1": "Hello, world!",                          // string
  "Prop2": 123,                                      // int
  "Prop3": 9223372036854775807,                      // long
  "Prop4": 12345.6789,                               // double
  "Prop5": 99999.99,                                 // decimal
  "Prop6": true,                                     // bool
  "Prop7": "2025-06-29T15:30:00",                    // DateTime
  "Prop8": "3fa85f64-5717-4562-b3fc-2c963f66afa6",   // Guid
  "Prop9": "AAECAwQFBgc=",                           // byte[] (Base64编码字符串)
  "Prop10": 3.14,                                    // float
  "Prop11": 32767,                                   // short
  "Prop12": "A",                                     // char
  "Prop13": 4294967295,                              // uint
  "Prop14": 18446744073709551615,                   // ulong
  "Prop15": 65535,                                   // ushort
  "Prop16": -128,                                    // sbyte
  "Prop17": 255,                                     // byte
  "Prop18": "12:34:56"                               // TimeSpan (符合ISO 8601格式)
}

关键格式规则

  • 数值类型:直接使用数字字面量,不要添加引号(如123而非"123")
  • 布尔类型:使用小写的true或false,不要加引号
  • DateTime:采用ISO 8601标准格式的字符串(YYYY-MM-DDTHH:MM:SS)
  • Guid:使用标准的GUID格式字符串(如"3fa85f64-5717-4562-b3fc-2c963f66afa6")
  • byte[]:转换为Base64编码的字符串
  • TimeSpan:使用符合ISO 8601规范的时间间隔字符串

内容的提问来源于stack exchange,提问作者Hadi Mazareei

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 18:52:33