-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
What if the object posted contains nested objects too:
POST /contacts
{
name: "foo"
age: 5
address: {
city: "ny",
street: "bar 45"
}
}
We need to augment the input_schema property and restserver.type_check() functionality to handle such cases. We could add a new schema property to the field that contains the nested validation object.
For example:
...
input_schema = {
name = { type = "string"},
age = { type = "number"},
address = {type = "table", schema = {
city = { type = "string" },
street = { type = "string"}
}
}
value_float = { type = "number", optional = true },
contact = {type = "table"
},
...
Reactions are currently unavailable