-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Command line options to emit custom response codes in swagger doc (#3)
* Implemented cmd-line options to emit custom response codes in swagger doc * Addressed reviewer comments * Addressed reviewer comments * Addressed reviewer comments * Addressed reviewer comments
- Loading branch information
1 parent
d813277
commit f14c5b8
Showing
11 changed files
with
1,628 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
package main | ||
|
||
import "github.com/spf13/pflag" | ||
import ( | ||
"github.com/spf13/pflag" | ||
|
||
svc "github.com/infobloxopen/atlas-openapiv2-patch/pkg/svc" | ||
) | ||
|
||
var ( | ||
swaggerFiles = pflag.StringSlice("files", []string{}, "input swagger file location") | ||
withPrivate = pflag.Bool("with_private", false, "if unset, generate swagger schema without operations 0 as 'private' work only if atlas_patch set") | ||
withCustomAnnotations = pflag.Bool("with_custom_annotations", false, "if set, you became available to use custom annotations") | ||
|
||
// Allow API response codes to be overridden for POST, PUT, PATCH and DELETE calls. | ||
// Note: Since GET always returns a 200, we don't permit overriding the response for that method alone. | ||
withPostResponse = pflag.Int("with_post_response", svc.DefaultPostResponse, "if set, generate swagger doc with the given response code for the POST API") | ||
withPutResponse = pflag.Int("with_put_response", svc.DefaultPutResponse, "if set, generate swagger doc with the given response code for the PUT API") | ||
withPatchResponse = pflag.Int("with_patch_response", svc.DefaultPatchResponse, "if set, generate swagger doc with the given response code for the PATCH API") | ||
withDeleteResponse = pflag.Int("with_delete_response", svc.DefaultDeleteResponse, "if set, generate swagger doc with the given response code for the DELETE API") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.