Skip to content

Commit

Permalink
Fix HTTP codes for response wrapper (grpc-ecosystem#5)
Browse files Browse the repository at this point in the history
* fix HTTP codes for response wrapper
  • Loading branch information
askurydzin authored Oct 3, 2018
1 parent 81560ad commit 4993fce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions protoc-gen-swagger/genswagger/atlas_patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package genswagger
// This patch is introduced for several cases that are applicable in
// atlas-app-toolkit:
//
// - Ability to wrap Responses with correct error codes (200, 201, 202, 203)
// - Ability to wrap Responses with correct error codes (200 - for GET, 201 - for POST/PUT/PATCH, 204 - for DELETE)
//
// - Ability to identify and append correct documentation with atlas.app.toolkit
// special types: filtering, sorting, paging, field_selection, atlas.rpc.identifier.
Expand Down Expand Up @@ -373,9 +373,9 @@ func opToCode(on string) int {
return map[string]int{
"GET": 200,
"POST": 201,
"PUT": 202,
"PATCH": 202,
"DELETE": 203,
"PUT": 201,
"PATCH": 201,
"DELETE": 204,
}[on]
}

Expand Down

0 comments on commit 4993fce

Please sign in to comment.