-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Milestone
Description
I made a boo boo and passed an array to these methods instead of calling the method with them as individual parameters, fixed my mistake after realizing I was doing it wrong via the crypt 400 response and second look at the readme, but was wondering if you would be open to that as an acceptable form of input, for example:
validate: {
payload: {
latitude: Hapi.types.Number()
.min(-90).max(90)
.optional()
.with(['longitude','radius'])
longitude: Hapi.types.Number()
.min(-180).max(180)
.optional()
.with(['latitude', 'radius'])
radius: Hapi.types.Number()
.min(0)
.optional()
.with(['latitude', 'longitude'])
}
}instead of:
validate: {
payload: {
latitude: Hapi.types.Number()
.min(-90).max(90)
.optional()
.with('longitude','radius')
longitude: Hapi.types.Number()
.min(-180).max(180)
.optional()
.with('latitude', 'radius')
radius: Hapi.types.Number()
.min(0)
.optional()
.with('latitude', 'longitude')
}
}If you don't like the idea then we can close the issue otherwise I'll send a pull request later.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels