Comments (3)
Hello @Wulfheart and thank you for your suggestion! You will be happy to hear that I have already implemented this feature for v5. It looks almost exactly like your example. The only difference is that rule sets are now returned by functions that have access to the current request:
func EchoBody(r *goyave.Request) v.RuleSet {
return v.RuleSet{
"text": v.List{v.Required(), v.String(), v.Between(3, 5)},
}
}
It is still compatible with composition and has improved field comparison mechanism, among other things.
from goyave.
Ah. Thanks for the information. In this case it is already supported.
from goyave.
v5 is not out yet and there is still a lot of work to do.
from goyave.
Related Issues (20)
- CORS options not working on subrouters
- Migrate from dgrijalva/jwt-go to golang-jwt/jwt
- Validating arrays of objects
- "exists" validation rule
- Validation "Required if" HOT 2
- Validation rules composition
- Validation date before/after now
- Instances HOT 8
- Allow raw SQL query in Paginator
- go-sqlmock integration
- Adapt framework to DB views
- Don't force test env in test suites
- HTTP cache implementation as middleware HOT 2
- Post-validation hook
- Validation context: access to request object
- Http Client for goyave HOT 6
- response.Error() doesn't take response status into account in debug mode
- Exists/Unique validation rule panics when input type doesn't match database column type HOT 1
- Panic when parsing multipart form with an empty file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goyave.