-
-
Notifications
You must be signed in to change notification settings - Fork 453
Closed as not planned
Labels
resolution:duplicateThis issue or pull request already existsThis issue or pull request already exists
Description
I have a complex data bucket like this one:
{
"tenants": {
"smarti": {
"id": "smarti",
"sites": {
"ST0001": {
"id": "ST0001",
"name": "Milano",
"tz": "Europe/Rome"
},
"ST0005": {
"id": "ST0005",
"name": "Atlanta",
"tz": "America/New_York"
}
},
"devices": {
"DV00010591": {
"id": "DV00010591",
"name": "Device 1",
"siteId": "ST0001",
"feeds": [
{
"address": "temp"
},
{
"address": "hum"
}
]
},
"DV00010592": {
"id": "DV00010592",
"name": "Device 2",
"siteId": "ST0001",
"feeds": [
{
"address": "temp"
},
{
"address": "hum"
}
]
},
"DV00050593": {
"id": "DV00050593",
"name": "Device 3",
"siteId": "ST0005",
"feeds": [
{
"address": "temp"
},
{
"address": "hum"
}
]
}
}
},
"ioti": {
"id": "ioti",
"sites": {
"ST0025": {
"id": "ST0025",
"name": "Firenze",
"tz": "Europe/Rome"
},
"ST0029": {
"id": "ST0029",
"name": "Beijing",
"tz": "Asia/Shanghai"
}
},
"devices": {
"DV00250534": {
"id": "DV00250534",
"name": "Device 4",
"siteId": "ST0025",
"feeds": [
{
"address": "temp"
},
{
"address": "hum"
}
]
},
"DV00250535": {
"id": "DV00250535",
"name": "Device 5",
"siteId": "ST0025",
"feeds": [
{
"address": "temp"
},
{
"address": "hum"
}
]
},
"DV00290596": {
"id": "DV00290596",
"name": "Device 6",
"siteId": "ST0029",
"feeds": [
{
"address": "temp"
},
{
"address": "hum"
}
]
}
}
}
}
}
that give me the possibility to mock a consistent set of data.
Now with mockoon it is very easy to create routes like these:
tenants/:id->{{data 'raw-datapoint-simulator' (concat 'tenants.' (urlParam 'id'))}}tenants/:tenantId/sites->{{data 'raw-datapoint-simulator' (concat 'tenants.' (urlParam 'tenantId') '.sites')}}tenants/:tenantId/devices/:deviceId->{{data 'raw-datapoint-simulator' (concat 'tenants.' (urlParam 'tenantId') '.devices.' (urlParam 'deviceId'))}}
so, I would like to have the possibility to create a RULE that returns a 404 if a json-path selection on a specific data bucket does not match anything
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
resolution:duplicateThis issue or pull request already existsThis issue or pull request already exists