Validation
jonathanrdelgado opened this issue · comments
Jonathan Delgado commented
Fantastic project, firstly.
I think it would benefit greatly from basic validations on parameters. For example, if you require an integer cost to be submitted in the request, the following would be added to the api.json
"purchase": {
"args": ["id"],
"list": {
"path": "/purchases/"
},
"update": {
"path": "/purchases/:id/",
"method": "post",
"params": [
{
"name": "cost",
"validation": "integer",
"required": true
}
]
}
}
This cuts down on requests that will automatically be rejected by the API anyway, and most libraries include them.
Jonathan Delgado commented
Any comment on this? Open to a PR?
Pavan Kumar Sunkara commented
Yes, I am open to Pull Requests. I have been planning to include a type
for generating libraries n static type programming languages too.
Jonathan Delgado commented
Going to close this, this has been sitting in my issues list for years. I wish you my best on the project.