-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request params layer validation #845
Request params layer validation #845
Comments
Hi @tranthebao what is the database you use ? |
yes, i'm using db mysql. |
What you want is a validation layer in the router ? Actually you will have to manually add it in your database structure. |
i'm see loopback when do method post then error server api return error. |
@tranthebao You've pointed out a great feature that we have to implement to make the framework better. There is already a feature request about the validation layer on the community vote page. We're thinking about implementing Joi directly on the router like Hapi does. It works great and it's perfect to validate incoming and outcoming data. What do you think about that? |
I was just looking at https://github.com/koajs/joi-router. Looks very good for this. |
I'm closing this issue because we'll implement it (see https://portal.productboard.com/strapi/c/14-validations). Feel free to give me more insights or upvote the card. |
@nurikabe, apparently it has been tried in the past and it did not work (https://github.com/strapi/koa-router-joi). I'm wondering why?! |
Node.js version:
v8.9.4
npm version:
v5.6.0
Strapi version:
3.0.0-alpha.11.1
Operating system:
windows 8.1 64bit
Do you want to request a feature or report a bug?
I' want to validated when use to rest api.
When use action in controller ("Add") then input value >50(role settings is 30) and post it.
Result not return validate. How to support for me.
Thank you a lot of.
What is the current behavior?
I'm not attach validate in model when rest api.
If the current behavior is a bug, please provide the steps to reproduce the problem
{
"connection": "default",
"collectionName": "book",
"info": {
"name": "book",
"description": ""
},
"options": {
"increments": true,
"timestamps": true,
"comment": ""
},
"attributes": {
"title": {
"maxLength": 50,
"multiple": false,
"type": "string",
"unique": true,
"required": true
},
"author": {
"model": "author",
"via": "book"
}
}
}
when use ajax rest api.
title input is null but action "add" continue insert to db.
What is the expected behavior?
I'm want to validated model when action rest api.
The text was updated successfully, but these errors were encountered: