在scala中加载和设置json值
我不熟悉scala和Cumber。我在项目的参考资料中有以下json文件在scala中加载和设置json值,scala,cucumber,bdd,Scala,Cucumber,Bdd,我不熟悉scala和Cumber。我在项目的参考资料中有以下json文件 { "town": { "address": { "Dates": [ { "startDate": "" } ], "condtion": { "includeAll"
{
"town": {
"address": {
"Dates": [
{
"startDate": ""
}
],
"condtion": {
"includeAll": [
{
"type": "",
"id": "",
"details": [
{
"destination": ""
}
]
},
{
"includeAny": [
{
"type": "",
"id": "",
"details": [
{
"value": ""
}
]
}
]
}
]
}
"FinalId": "N9"
}
}
}
字段在此文件中保持为空。在我的功能文件中,示例中有以下信息:
Given:...
When: ...
Then: ...
Examples:
| includeAll | includeAny |
|typeValue;idValue;destination,typeValue1;idValue1;destination1 | typeValue2;idValue2;destination2,typeValue3;idValue4;destination4
字段值由delimeter“;”分隔,特定组合由另一个delimeter“,”分隔。我可能会在我的功能文件中使用typeValue、idValue、destinationValue to的许多组合,它们之间用“,”分隔,我需要加载空json并将它们设置在json中,然后将json存储在变量或文件中。includeAll任何值都可能存在,也可能不存在,但includeAll始终存在。如果未指定includeAny值,我不希望在最终json中包含“includeAny”。我该怎么做?指出哪些库用于json工作通常我使用的是spray json。但我的任何图书馆都足够了