Skip to content

Where should validation of request payloads be done? #3639

Answered by raphael
RedMarcher asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, any validation defined on request payloads and response results are enforced during decoding (server side) and encoding (client side). This includes required fields and all other possible validations (min, max, min length, max length, pattern, format etc.). See for example https://github.com/goadesign/examples/blob/master/cellar/gen/http/storage/server/types.go#L264

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RedMarcher
Comment options

@raphael
Comment options

Answer selected by RedMarcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants