Skip to content

Commit

Permalink
Fix DefaultEncoder's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Mar 1, 2023
1 parent 3936e34 commit 45bebbc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (

// DefaultEncoder is the default encoder used by the router. It decodes GET
// requests using the query string and URL parameter; everything else uses JSON.
//
// For the sake of being RESTful, we use a URLDecoder for GET requests.
// Everything else will be decoded as JSON.
var DefaultEncoder = CombinedEncoder{
Encoder: EncoderWithValidator(JSONEncoder),
Decoder: DecoderWithValidator(MethodDecoder{
// For the sake of being RESTful, we use a URLDecoder for GET requests.
"GET": URLDecoder,
// Everything else will be decoded as JSON.
"*": JSONEncoder,
"*": JSONEncoder,
}),
}

Expand Down

0 comments on commit 45bebbc

Please sign in to comment.