gpt4 book ai didi

用于 int 列表的 JSON

转载 作者:IT老高 更新时间:2023-10-28 12:44:52 28 4
gpt4 key购买 nike

我有课

public class ItemList
{
public long Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public List<int> ItemModList { get; set; }
}

我应该如何为 int 列表提供输入 JSON,因为它没有匹配其值的键

JSON

{
"Id": "610",
"Name": "15",
"Description": "1.99",
"ItemModList": []
}

我应该在 ItemModList 中写什么

最佳答案

假设您的整数是 0、375、668,5 和 6:

{
"Id": "610",
"Name": "15",
"Description": "1.99",
"ItemModList": [
0,
375,
668,
5,
6
]
}

我建议您将 "Id": "610"更改为 "Id": 610,因为它是整数/长整数,而不是字符串。您可以在此处阅读更多关于 JSON 格式和示例的信息 http://json.org/

关于用于 int 列表的 JSON,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9114503/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com