added validation when adding a book
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package api
|
||||
|
||||
type bookPostCreate struct {
|
||||
Title string `json:"title" binding:"required"`
|
||||
Author string `json:"author"`
|
||||
Title string `json:"title" binding:"required,max=300"`
|
||||
Author string `json:"author" binding:"max=100"`
|
||||
Rating int `json:"rating" binding:"min=0,max=10"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user