From 39293d6ae09c5ff4d8dc9802141c64769a66bf8a Mon Sep 17 00:00:00 2001 From: Ivan Porto Carrero Date: Sat, 28 Feb 2015 21:12:25 -0800 Subject: [PATCH] generate a main method for the api --- Godeps/Godeps.json | 28 +++++----- cmd/swagger/commands/generate/all.go | 4 +- cmd/swagger/commands/generate/support.go | 10 ++-- cmd/swagger/commands/ui.go | 2 +- generator/bindata.go | 35 +++++++++--- generator/operation.go | 8 +-- generator/support.go | 59 ++++++++++++++++++--- generator/templates/modelvalidator.gotmpl | 28 +++++----- generator/templates/server/builder.gotmpl | 34 ++++++++++++ generator/templates/server/main.gotmpl | 45 ++++++++++++++++ generator/templates/server/parameter.gotmpl | 30 +++++------ util/util.go | 9 ++++ 12 files changed, 230 insertions(+), 62 deletions(-) create mode 100644 generator/templates/server/main.gotmpl diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 92c46bb5d..b1ad53da6 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,26 +1,26 @@ { "ImportPath": "github.com/casualjim/go-swagger", - "GoVersion": "go1.4.1", + "GoVersion": "go1.4.2", "Packages": [ "./..." ], "Deps": [ { "ImportPath": "github.com/PuerkitoBio/purell", - "Comment": "v0.1.0-14-gc350669", - "Rev": "c350669cafb929d7c3910ed8a49ff6877d5d50a9" + "Comment": "v0.1.0-23-gd69616f", + "Rev": "d69616f51cdfcd7514d6a380847a152dfc2a749d" }, { "ImportPath": "github.com/asaskevich/govalidator", - "Rev": "e43f387b7891260b3948717f64dcd146979a2af1" + "Rev": "91816a9260233d0c543ef35c8b2ac55d44be3339" }, { "ImportPath": "github.com/elazarl/go-bindata-assetfs", - "Rev": "00534a354892d0250efb8b422243df123f733c39" + "Rev": "09ba9c6a7e9a5ee35586127fdf88bb20bb4990b7" }, { "ImportPath": "github.com/golang/gddo/httputil", - "Rev": "bb1ac60e4a278210b176c686ed0c3c5620354ccd" + "Rev": "4ada458008ce9543ec7c68a6e21c850fab1c02bd" }, { "ImportPath": "github.com/gorilla/context", @@ -52,26 +52,30 @@ "ImportPath": "github.com/nu7hatch/gouuid", "Rev": "179d4d0c4d8d407a32af483c2354df1d2c91e6c3" }, + { + "ImportPath": "github.com/opennota/urlesc", + "Rev": "5fa9ff0392746aeae1c4b37fcc42c65afa7a9587" + }, { "ImportPath": "github.com/smartystreets/goconvey/convey", - "Comment": "1.5.0-356-gfbc0a1c", - "Rev": "fbc0a1c888f9f96263f9a559d1769905245f1123" + "Comment": "1.5.0-376-g507d829", + "Rev": "507d82961b11be9fc3c07aeb0fc338be0b757775" }, { "ImportPath": "github.com/stretchr/testify/assert", - "Rev": "efa3c4c36479edac5af79cbcb4bc8cb525e09b13" + "Rev": "e4ec8152c15fc46bd5056ce65997a07c7d415325" }, { "ImportPath": "golang.org/x/tools/go/ast/astutil", - "Rev": "753a094e8ab3f6e567ce75c7feebea04917a137f" + "Rev": "8913eaef7527f8112f65ce5c73f1282354de5fe0" }, { "ImportPath": "golang.org/x/tools/imports", - "Rev": "753a094e8ab3f6e567ce75c7feebea04917a137f" + "Rev": "8913eaef7527f8112f65ce5c73f1282354de5fe0" }, { "ImportPath": "gopkg.in/yaml.v2", - "Rev": "a1c4bcb6c278a41992e2f4f0f29a44b4146daa5c" + "Rev": "49c95bdc21843256fb6c4e0d370a05f24a0bf213" } ] } diff --git a/cmd/swagger/commands/generate/all.go b/cmd/swagger/commands/generate/all.go index 5138794b1..80f226b9f 100644 --- a/cmd/swagger/commands/generate/all.go +++ b/cmd/swagger/commands/generate/all.go @@ -26,6 +26,8 @@ type All struct { SkipModels bool `long:"skip-models" description:"no models will be generated when this flag is specified"` SkipOperations bool `long:"skip-operations" description:"no operations will be generated when this flag is specified"` SkipSupport bool `long:"skip-support" description:"no supporting files will be generated when this flag is specified"` + IncludeMain bool `long:"include-main" description:"generates a main package for the server"` + IncludeUI bool `long:"include-ui" description:"when generating a main package it uses a middleware that also serves a swagger-ui for the swagger json"` } // Execute runs this command @@ -39,7 +41,7 @@ func (a *All) Execute(args []string) error { } if !a.SkipSupport { - if err := generator.GenerateSupport(a.Name, a.Models, a.Operations, opts); err != nil { + if err := generator.GenerateSupport(a.Name, a.Models, a.Operations, a.IncludeMain, a.IncludeUI, opts); err != nil { return err } } diff --git a/cmd/swagger/commands/generate/support.go b/cmd/swagger/commands/generate/support.go index edfd2ac53..e7e375d09 100644 --- a/cmd/swagger/commands/generate/support.go +++ b/cmd/swagger/commands/generate/support.go @@ -8,9 +8,11 @@ type Support struct { Name string `json:"name" short:"A" description:"the name of the application" default:"swagger"` Operations []string `long:"operation" short:"O" description:"specify an operation to include, repeat for multiple"` // Tags []string `long:"tags" description:"the tags to include, if not specified defaults to all"` - Principal string `long:"principal" description:"the model to use for the security principal"` - Models []string `long:"model" short:"M" description:"specify a model to include, repeat for multiple"` - DumpData bool `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"` + Principal string `long:"principal" description:"the model to use for the security principal"` + Models []string `long:"model" short:"M" description:"specify a model to include, repeat for multiple"` + DumpData bool `long:"dump-data" description:"when present dumps the json for the template generator instead of generating files"` + IncludeMain bool `long:"include-main" description:"generates a main package for the server"` + IncludeUI bool `long:"include-ui" description:"when generating a main package it uses a middleware that also serves a swagger-ui for the swagger json"` } // Execute generates the supporting files file @@ -19,6 +21,8 @@ func (s *Support) Execute(args []string) error { s.Name, nil, nil, + s.IncludeMain, + s.IncludeUI, generator.GenOpts{ Spec: string(s.Spec), Target: string(s.Target), diff --git a/cmd/swagger/commands/ui.go b/cmd/swagger/commands/ui.go index d5d082bc9..0dff19066 100644 --- a/cmd/swagger/commands/ui.go +++ b/cmd/swagger/commands/ui.go @@ -30,7 +30,7 @@ func (d *ui) Execute(args []string) error { return err } if fi.IsDir() { - return fmt.Errorf("expected") + return fmt.Errorf("%s is a directory, expected a file", fileName) } orig := fileName diff --git a/generator/bindata.go b/generator/bindata.go index 4186cc485..a9a90b39f 100644 --- a/generator/bindata.go +++ b/generator/bindata.go @@ -81,7 +81,7 @@ func templates_model_gotmpl() (*asset, error) { return a, nil } -var _templates_modelvalidator_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xcc\x56\x51\x6f\xdb\x36\x10\x7e\xf7\xaf\xb8\x09\x19\x60\xaf\x89\xdc\x01\xc3\x1e\xd6\x65\x40\xd1\x79\x68\x80\x2e\x0d\x9a\x6e\x2f\xc3\x80\x32\x32\x25\xb3\x91\x48\x85\xa4\x9c\x78\x82\xfe\xfb\x8e\xa4\x28\x5b\xb2\xe4\x58\x0e\x06\xec\x49\xd2\xdd\xf1\xf8\xf1\xbb\xbb\x8f\x2a\xcb\x25\x8d\x19\xa7\x10\xe4\x92\x65\x4c\xb3\x35\x5d\x93\x94\x2d\x89\x16\x32\xa8\xaa\x49\x59\xb2\x18\xc2\x4f\xf4\xa1\x60\x92\x2e\xd1\x80\x9f\x54\x4a\xf8\xe9\x12\xea\x38\xda\x78\xa7\x65\x19\xde\x10\xbd\xaa\xaa\x73\x08\xf0\xfd\x83\x88\x88\x66\x82\x57\x55\x70\x0e\xf8\xfd\x27\x49\x0b\xba\x78\xca\x25\x55\xca\x9a\x67\x6f\x6c\xae\x6f\x2e\x81\xb3\x14\xca\x09\x80\xa4\xba\x90\xdc\x58\x27\x66\x6f\xca\x97\x0d\x86\xdf\x19\xff\x40\x79\x62\xd2\xf7\x81\x68\xdc\xa3\x51\x58\xeb\x4e\xf6\x71\xa8\xc8\xd3\x41\x54\xde\x7d\x22\xaa\x6d\xf6\x51\xa8\x70\x27\x4d\x25\xef\xc7\x54\x3b\x4f\x40\xf4\xc5\x2d\x71\xa9\xbf\x8c\xad\x1e\xcb\x8a\x6c\xb0\x76\xc6\x79\x10\x51\x9c\x0a\xa2\x7f\xfc\x61\xda\xdb\x47\xbe\x84\x6e\x0b\xfb\xb5\x78\x8a\xd2\x42\x61\x3b\x37\xe6\xb1\x75\x3d\x80\xd7\x39\x5f\x8a\xd7\x6f\xd1\xc1\xeb\xcd\xe3\xf0\x16\xa9\x66\x79\x4a\x3f\xc6\x03\x90\x1b\xff\x4b\x51\xef\x6c\x34\x0a\xe1\x82\x0f\xd1\x69\x3c\xa7\xcd\x87\xcb\x79\x34\x0c\xff\xf4\x92\x17\x15\x4a\x8b\x2c\x16\x32\x23\xba\xa5\x7a\x3d\x20\x7f\xb3\x51\xcf\xd0\x67\x0c\x2e\xd0\x7e\x2a\x2d\x19\x4f\x86\xc8\x74\xfb\xaa\xa3\xd1\x7b\xd4\x2a\x65\x51\x9f\x48\x5f\x53\xba\x54\xb7\xec\x1f\x6a\x2d\x08\x52\x92\xec\x9a\x64\xf8\x69\x8c\xe6\x30\x8c\x9b\xda\xa6\x94\xf7\x43\x9a\xed\xcf\xec\x95\xa6\x99\x1a\x1c\x5a\xeb\x7d\xae\x72\x1d\x1c\x7e\x54\xeb\xcc\x63\x87\xf2\x10\xa0\xda\x7b\x12\xa0\x26\xf3\x28\x40\x7f\x70\xf6\x50\xd0\x03\x98\x76\x02\xfe\xdb\xdb\xf1\x7f\x30\x5d\x06\xc6\x2d\xf6\x7b\x4a\x6f\xa3\x15\xcd\xc8\xad\xe9\x53\x40\xd7\x7c\x0e\xca\xda\x41\x59\x47\xef\x8e\x13\x1c\x07\x60\x06\xf9\xeb\x37\xf8\xfc\x19\x06\xdb\x14\xdd\xaf\x5e\x21\x90\xb2\x94\x84\x27\x14\x42\xcf\x3f\x60\x62\x7c\xcd\x53\x3c\xb6\xf9\x9f\x11\x39\x95\x7a\xb3\x9d\x14\x08\x77\x54\xc0\xbe\xa5\x8a\x3a\x7c\x5c\xe8\x7d\x8c\x37\x75\x06\xd7\x2b\x2f\xdc\xcf\xf1\xf3\x76\xb9\x64\x86\x78\x92\x6e\x93\x34\x07\xc7\x2d\xad\x15\xaf\xfc\xaa\x32\x24\x20\x0b\x76\x5a\x67\x70\xd1\x76\x1a\xc3\xf7\x26\xc2\x12\x01\x70\x14\x12\x80\x9d\x33\x23\x98\x41\x82\xe1\x97\xf6\x6e\x9d\xa2\x0b\xa9\xba\xe7\xb8\x16\xfa\x6d\x9a\x8a\x47\xfc\x07\x0c\xfa\x52\x06\x7b\x6d\x37\xeb\x15\xe6\xae\xd4\x89\xbb\xaf\x34\x6a\x4b\x33\x16\xcb\xc9\x36\x38\xa7\x81\xfa\x2b\xd1\xe4\xf3\x26\xa7\xad\x01\xe8\xc3\x61\x2c\x76\x2a\xa6\xa7\x8a\xef\x3e\xb7\x4d\x6d\xaf\xd4\x8d\xff\x85\xae\xaa\x76\x3d\xf6\xfe\xac\x7d\x6b\x60\x31\xc0\xad\x7d\x67\x0f\xe5\x2e\x0f\xfc\xc1\x6a\x67\xe8\xbf\xa8\x7a\x92\x08\xae\x09\xe2\xec\x2c\xef\xdc\x18\x7d\xeb\x30\x94\x3e\x7d\xb4\x8c\xb6\xd7\x76\x4b\x60\x16\x77\x0b\x96\x93\xe8\x9e\xe0\x64\x58\x95\xb1\xaf\x68\x34\x95\xfa\xbc\x62\x0a\x62\x86\x53\xf5\x48\x14\x24\x14\x91\x61\xd2\x25\xdc\x6d\x40\xaf\x70\xd4\x1e\x49\x92\x50\x09\x5a\x88\x34\x34\xf1\x0b\xd3\x55\x3c\x41\xa7\x5f\x97\xb1\x64\xa5\x01\x59\x5f\x53\x88\x0b\x6d\x53\xad\x28\x87\x8d\x28\xb0\x54\x17\xb2\xe0\xad\x4c\x7e\x0b\x88\x44\x96\x11\xbe\x9c\x4c\x58\x96\x0b\xa9\x61\x8a\xa5\x0d\x12\xa6\x57\xc5\x5d\x88\xbe\x79\x44\x54\x41\xd2\xaf\x2c\x9b\x27\xe2\xa2\x5e\x3d\x77\xcd\x1d\x1c\x13\x8a\x57\x7b\x9c\xe9\xa3\x42\xbd\x12\x07\x13\xab\x18\x4e\x44\xce\xee\xe9\xe6\x1c\xce\xd6\xa6\x43\x4d\xb7\x86\x57\x16\xa7\x97\x15\xe3\x36\x83\x57\xe2\xd1\xf1\xd6\x8e\x21\xf8\xf6\x21\xa8\xc3\xeb\x10\x47\xfd\xcc\xf2\xec\xdb\xba\x51\x7d\xe5\x28\xc4\x82\xbc\x2f\x90\x87\x77\x29\x51\xaa\x96\xb1\xb8\xe0\x11\x98\xc1\xff\x44\x23\x8a\x4d\x29\x9d\x1d\xbe\x43\xd3\x4e\xdc\x0c\xba\xb3\x02\xee\xcc\xb8\x2e\x61\xf8\xba\x99\x39\x31\xb0\x53\xe3\x26\xe0\x3d\x51\xf5\x22\x9c\x36\x77\x94\x35\x91\x58\x27\x05\x7f\xfd\x6d\x83\x77\x29\xf0\xfa\xca\xa8\x3f\xf5\x40\x8e\xd6\x4c\xb7\x51\x87\xfe\xc0\x7b\x72\x3d\x3c\xe1\x60\x01\x5d\x02\xc9\x73\xe4\x70\x8a\x1f\xe7\x26\x64\x66\x05\x72\xcb\xec\xf6\xcd\x41\x30\x72\x89\xb1\x46\x1d\x5f\x37\x79\x76\x35\xd1\x0c\x91\x50\x4c\xd3\x2d\xfe\x85\xf1\x98\x55\x61\x18\xee\xe7\xaf\x97\x23\x2e\x2b\x35\x70\x16\x79\xfa\x6d\x47\x34\xc5\x80\xdd\xcb\xa7\x45\xda\x00\x65\x87\x6a\xbc\xdd\xc4\xd4\xf8\x59\xfa\x0e\x17\xfd\xd9\x3b\x67\xff\x94\x6d\xe5\xf8\x37\x00\x00\xff\xff\x97\xa4\x77\x70\x7f\x10\x00\x00") +var _templates_modelvalidator_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xcc\x56\x5f\x6f\xdb\x36\x10\x7f\xf7\xa7\xb8\x09\x19\x10\xaf\x89\xd2\x01\xc3\x1e\xd6\x65\x40\xd1\x65\x68\x80\x2e\x0d\x9a\xae\x2f\xc3\x80\x32\xf2\x49\x66\x2b\x91\x0a\x49\x25\xf1\x04\x7d\xf7\x1d\x49\x51\xb6\x64\xd9\xb1\x1d\x0c\xe8\x93\xa4\xbb\xe3\xdd\xef\xfe\xfd\xa8\xba\x9e\x61\xca\x05\x42\x54\x2a\x5e\x70\xc3\xef\xf1\x9e\xe5\x7c\xc6\x8c\x54\x51\xd3\x4c\xea\x9a\xa7\x10\x7f\xc0\xbb\x8a\x2b\x9c\x91\x80\x3e\x51\x29\xf8\xe5\x1c\x5a\x3b\x2e\x45\xa7\x3f\xae\xeb\xf8\x9a\x99\x79\xd3\x9c\x40\x44\xef\xef\x64\xe2\x0c\x9a\x26\x3a\x01\xfa\xfe\xc4\xf2\x0a\x2f\x1e\x4b\x85\x5a\x3b\xf1\xf4\x95\xf3\xf6\xdd\x39\x08\x9e\x43\x3d\x01\x50\x68\x2a\x25\xac\x74\x62\xa3\xa3\x98\x75\x28\xfe\xe4\xe2\x1d\x8a\xcc\xba\x1f\x87\xd1\x19\xec\x8d\xc3\x49\x57\xfc\xef\x87\x8b\x3d\x3e\x81\x2b\x18\x1c\x88\x6b\xe9\x7f\x2f\x5c\x14\xc9\xa0\x12\x9b\x50\xb5\xea\x03\x30\x7d\xf6\x47\xbc\xf3\xcf\xfb\xf6\x90\x17\x55\xb1\xa5\x83\x56\xbd\x15\x53\x9a\x4b\x66\x7e\xfe\xe9\x78\x74\x9e\x42\x23\x7d\x10\xf7\x75\xf1\x98\xe4\x95\xa6\xc1\xee\xc4\xfb\x76\x77\x2b\x62\xaf\x7e\x2e\xe2\x10\x64\x80\x38\x88\xf7\x43\x5c\xe5\x86\x97\x39\xbe\x4f\x37\x82\xee\x2c\x9e\x8b\x7b\x25\xd4\x5e\x18\x2f\xc4\xe6\x92\x5a\xdd\x61\x9b\xe2\xbd\xee\x0c\x24\x3c\x03\x05\x26\x95\x36\xb2\x48\xa5\x2a\x98\xe9\xb1\xe0\x28\xcc\x3f\x9c\xdd\x13\x25\xb4\x02\x6f\xe8\x3e\xb5\x51\x5c\x64\x9b\x0a\xea\x23\xeb\x9d\xf1\x07\xdc\x3a\xe7\xc9\x18\x6d\x5f\x21\xce\xf4\x0d\xff\x17\x9d\x84\x40\x2a\x56\x5c\xb1\x82\x3e\xad\xd0\xa6\xc3\x85\xed\x6f\x8e\x62\x1c\xd2\x74\x7d\x7b\x2f\x0d\x16\x7a\xcb\xfa\x3a\xfd\x53\xdd\x1b\x20\x09\x4b\xdb\xfa\xde\x77\x3d\xb7\x43\x6a\xf5\x07\x41\xea\x7c\xef\x05\xe9\x2f\xc1\xef\x2a\xdc\x8a\x6a\xc5\xe4\xff\xbd\x33\xbf\x89\x3d\xb3\x40\x6e\x68\xee\x73\xbc\x49\xe6\x58\xb0\x1b\x3b\xaf\x40\xaa\xb3\x33\xd0\x4e\x0e\xda\x29\x46\x23\x4e\x68\x2d\x80\x5b\xec\x2f\x5f\xd1\xf3\x57\xd8\x38\xae\xa4\x7e\xf1\x82\x80\xd4\xb5\x62\x22\x43\x88\x43\x0f\x80\x1c\xd3\x6b\x99\x33\xe3\xfe\x74\x64\x89\xca\x2c\x96\x1b\x03\xf1\x0a\x1f\xb8\xb7\x5c\xa3\xc7\x27\xa4\x59\xc7\x78\xdd\x7a\xf0\xf3\xf2\xcc\x78\xbe\x3e\xaf\x67\x33\x6e\x0b\xcf\xf2\xa5\x93\x2e\x71\x0a\xe9\xa4\xf4\x1b\xd0\x34\xb6\x08\x54\x05\xb7\xb5\x53\x38\xed\x2b\xad\xe0\x47\x6b\xe1\x0a\x01\xb0\x13\x12\x80\x95\x9c\x09\xcc\xc6\x02\xc3\x6f\xfd\x68\x83\xa6\x4b\xa5\x87\x79\x5c\x49\xf3\x3a\xcf\xe5\x03\xfd\x1b\x46\x63\x2e\xa3\xb5\xb1\x9b\x8e\x52\xf4\x90\xf2\xe4\xed\x17\x4c\xfa\x24\x4d\xcd\xf2\x04\x0e\x5e\x69\xa1\xfe\xce\x0c\xfb\xb8\x28\xb1\xb7\x02\x63\x38\xac\xc4\xba\xc2\xe3\x43\x49\x78\xbd\xb6\x5d\x6f\x2f\xf5\x75\xf8\xb9\x6e\x9a\x7e\x3f\xd6\xfe\xb9\xc3\x68\x50\x33\xc0\x9f\x7d\xe3\x92\xf2\x97\x08\xfd\x72\xf5\x3d\x8c\x5f\x59\x23\x4e\xa4\x30\x8c\x70\x0e\x8e\x0f\x6e\x8e\xb1\x73\x64\x8a\x8f\xef\x5d\x45\xfb\x67\x87\x2d\xb0\x87\x87\x0d\x2b\x59\xf2\x95\xd1\x66\x38\x96\x71\xaf\x24\xb4\x9d\xfa\x38\xe7\x1a\x52\x4e\x5b\xf5\xc0\x34\x64\x48\xc8\xc8\xe9\x0c\x6e\x17\x60\xe6\xb4\x6a\x0f\x2c\xcb\x50\x81\x91\x32\x8f\xad\xfd\x85\x9d\x2a\x91\x91\x32\x9c\x2b\x78\x36\x37\x40\x55\xbf\x47\x48\x2b\xe3\x5c\xcd\x51\xc0\x42\x56\xd4\xaa\x53\x55\x89\x9e\xa7\x10\x02\x12\x59\x14\x4c\xcc\x26\x13\x5e\x94\x52\x19\x38\xa6\xd6\x46\x19\x37\xf3\xea\x36\x26\xdd\x59\xc2\x74\xc5\xf2\x2f\xbc\x38\xcb\xe4\x69\x7b\xfa\xcc\x0f\x77\xb4\x8b\x29\x5d\xf1\x69\x61\x76\x32\x5d\x72\x71\x34\x71\x9c\xe1\x69\xe4\xe8\x2b\x2e\x4e\xe0\xe8\xde\xce\xa8\x9d\xd7\xf8\xd2\x21\x0d\xc4\x62\xd5\x76\xf5\x6a\x4a\x9e\xee\xef\x14\xa2\xef\xef\xa2\xd6\xbc\x35\xf1\xc5\x9f\xba\x4a\x87\xc1\x0e\xcc\x8f\xda\x17\x91\x5a\xf2\xb6\xa2\x4a\xbc\xc9\x99\xd6\x2d\x91\xa5\x95\x48\xc0\xae\xfe\x07\x4c\x90\xc6\x52\x79\x39\xfc\x40\xa2\x15\xbb\x29\x0c\xb7\x05\x7c\xd6\x74\x2e\xe3\xf4\xba\x98\x7a\x3a\x70\x7b\xe3\x77\xe0\x2d\xd3\x9f\xba\x74\x7d\x2a\xf7\x4c\x51\xa7\x34\xfc\xfd\x8f\x33\x5e\x2d\x41\x60\x58\x8e\x21\xeb\x0d\x3e\x7a\x5b\xdd\x47\x1d\x87\x84\xd7\x08\x7b\xf3\x8e\x83\x03\x74\x0e\xac\x2c\xa9\x86\xc7\xf4\x71\x62\x4d\xa6\x8e\x22\x97\x95\x5d\xbe\x79\x08\x96\x30\xc9\xd6\xf2\xe3\xcb\xce\xcf\x2a\x2b\xda\x35\x92\x9a\x1b\x5c\xe2\xbf\xb0\x1a\x7b\x2a\x8e\xe3\x75\xff\xed\x71\xc2\xe5\xc8\x06\x8e\x92\x50\x7e\x37\x11\x5d\x33\x60\xf5\xfa\xe9\x15\x6d\x43\xc9\xb6\xf5\x78\x19\xc4\xf6\xf8\xc9\xf2\x6d\x6f\xfa\x93\xb7\xce\x7a\x96\x7d\xee\xf8\x2f\x00\x00\xff\xff\xab\xf0\x81\xc3\x9b\x10\x00\x00") func templates_modelvalidator_gotmpl_bytes() ([]byte, error) { return bindata_read( @@ -96,12 +96,12 @@ func templates_modelvalidator_gotmpl() (*asset, error) { return nil, err } - info := bindata_file_info{name: "templates/modelvalidator.gotmpl", size: 4223, mode: os.FileMode(420), modTime: time.Unix(1425156718, 0)} + info := bindata_file_info{name: "templates/modelvalidator.gotmpl", size: 4251, mode: os.FileMode(420), modTime: time.Unix(1425183236, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _templates_server_builder_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x58\x6d\x6f\xdb\xb6\x13\x7f\xfd\xf7\xa7\x38\x18\x2d\x20\x15\xaa\xf2\x7f\x1d\x20\x03\xb2\xa6\x43\xb3\x61\x5d\x91\x14\xdb\x8b\x20\x18\x18\xe9\x6c\x73\xd1\x53\x49\x2a\x99\x17\xf8\xbb\xef\xf8\x24\x51\x96\xec\xda\x4d\x8a\x19\x01\x22\x91\xc7\x7b\xbe\xdf\x1d\xd5\xb0\xec\x9e\x2d\x11\x9e\x9e\xd2\x4f\xf6\x71\xb3\x99\xcd\x4e\x4e\xe0\xf3\x8a\x4b\x58\xf0\x02\xe1\x91\x49\x58\x62\x85\x82\x29\xcc\xe1\x6e\x0d\x6a\x85\x20\x1f\xd9\x72\x89\x02\x54\x5d\x17\xa9\xa6\x7f\x9f\x73\xc5\xab\x25\x6d\xfa\x73\x25\x5f\xae\x14\x34\xa2\x7e\x40\x58\xb4\xca\xb0\x5a\x61\x05\xeb\xba\x05\x81\x6f\x45\x5b\x0d\x38\x79\x11\x90\xd5\x65\xc9\xaa\x7c\x36\xe3\x65\x53\x0b\x05\xd1\x0c\x60\x2e\x95\x20\xee\x72\xae\x9f\x2b\x54\x27\x2b\xa5\x1a\xf3\xb2\xe4\x6a\xd5\xde\xa5\x74\xe8\x24\x63\xb2\x65\xc5\x5f\xbc\x3c\x59\xd6\x6f\x1d\xdb\x43\x68\x4e\x64\x83\xd9\x61\x84\x4a\x2c\x4a\x75\x10\x69\xc9\xf3\xbc\xc0\x47\x26\xf0\x48\xf2\x13\x89\x59\x2b\xb8\x5a\xcf\x67\x74\xf0\xe9\x49\xb0\x8a\xe2\xf3\xea\x1e\xd7\x09\xbc\x7a\x60\x45\x8b\x70\x7a\x06\xe9\xa5\x71\x8e\xa4\x68\x69\x22\xbd\xbd\xd9\xd0\x03\xf9\x9b\x57\x6a\x01\xf3\xd7\x5f\xe6\x8e\xdc\x91\x60\x95\xd3\x53\x6c\x82\x4b\xd1\x3e\x6f\x9a\x8f\xac\xa4\xcd\xf3\x4f\x97\xfa\xfd\xb2\x5a\xd4\xe9\x05\xca\x4c\xf0\x46\xf1\xba\x22\x5a\xb5\x6e\x70\x44\x4a\x2e\x68\x33\x05\x4f\xc4\x53\xbb\x0d\xfa\xdf\x1b\xfd\x9e\x5e\xd4\x59\x5b\x62\xa5\x68\x3f\xab\x2b\x85\x7f\xab\x6e\xbf\xb7\x31\x7d\x67\xb7\x88\x68\x45\xa1\x2e\x50\x48\x47\x54\xb2\xe6\xc6\xc6\xfa\x56\x87\x38\xfd\x60\xb7\x89\x70\x51\x8b\x92\x29\x4f\x07\x36\x14\xe9\x15\x2e\x39\x3d\xae\x03\x57\x69\xe6\x92\x74\x20\xdf\x58\x53\xdf\x15\x4c\x4a\x6b\x81\xdb\x12\x94\x80\xfa\x9c\x96\xcb\xb4\x9e\x76\x91\x44\xd0\xeb\x9c\x8e\xfc\x8a\x39\x67\x9f\xc9\xfe\xcd\x66\x4e\x89\x5c\x22\x68\x67\x18\x21\x93\xec\x5c\x18\xbd\x68\x11\x78\x3c\x50\xec\x93\xa8\xf3\x36\x9b\x54\xcc\x6d\x0d\x15\x6b\xfc\xe2\xd1\x8a\x75\xec\xbc\x62\x7e\x61\x5a\xb1\x6b\x97\x72\x17\xb8\xe0\x15\xd7\xe1\xf7\x89\xc5\x17\x94\x6a\xf2\x47\x26\x79\x76\xde\xaa\xd5\x84\xe6\x7a\x79\xa0\xf5\xa2\xad\x32\xcd\x82\xaa\x9b\x29\x50\xec\x1e\x25\xb4\x12\x45\x45\xe4\x40\xe1\x84\x86\xce\x3e\xd6\x22\x37\x2f\x02\x55\x2b\x2a\x6b\x2d\xaf\x32\xde\xb0\x82\x04\x93\x14\x4e\xd8\x81\x42\x47\x9d\x36\x49\x06\xe5\x14\xcf\x98\x61\xfc\x48\xc5\x04\x77\x5a\x27\xb3\x33\xb2\xde\xa8\xa4\xd5\x88\x6c\x2a\x25\x60\xff\xc7\x10\x69\x9c\xf3\x72\x36\x9b\x04\x50\x88\x5a\xc4\xbd\x57\xbc\xc5\x94\xea\xbf\xe0\xfa\x39\x26\x33\xc2\xc6\x7b\x82\xbb\x6f\x35\x92\xec\x23\xb8\xad\x35\x03\x60\x0d\x07\xaa\x70\xad\x86\xd5\xc0\xc0\x2a\xcf\x89\x80\x5b\x14\xa5\x9d\xeb\xba\x15\x99\xaf\xf6\x7d\xee\x38\xc0\x0d\xd3\x69\xf2\x5b\xa3\x11\xda\x66\xc7\xc8\x29\xae\x52\x41\x22\x15\xa9\x56\xa9\xf6\xd4\xbe\xc6\x4d\x1a\x3b\x65\x3f\xb4\x84\xf1\xc1\xe9\x9e\xba\x4b\xbb\xae\x1f\x4d\xcb\x09\x3b\x56\x3a\x49\x62\x8d\x28\xe4\x3e\x16\xbb\x4e\x8d\x9c\x40\xf6\x5e\xa3\x78\xc0\xf7\xda\x53\x40\x3d\x2e\x63\x45\x41\xfe\x37\x2d\x8d\x42\x84\x7e\x5d\x60\x86\xfc\x01\xf3\x44\x9b\x2a\x50\x2f\x31\xc8\x71\xc1\xda\x42\x79\x4f\x58\x7e\x77\xad\x32\xcd\x30\xa3\xe3\xe4\x35\xfd\x2c\xa0\x7e\x74\xf9\xad\x1b\x29\xd1\x05\x42\xf5\xcf\x84\xd1\x20\xe3\x15\xca\x86\x22\x81\x7f\x50\xe1\xa2\x48\xe0\x8d\x5b\xfd\xd2\xa2\x54\x5d\x44\x6d\x33\xff\xc9\x61\xa7\xcf\x43\x1d\x04\x9f\xbf\x64\x83\x4d\x0b\x8f\xb0\x33\x2d\xc3\xa4\xc8\x95\x35\x45\xb8\x10\xbd\xd9\xea\x05\xb1\xe7\x1b\xc5\xdb\x70\x4c\xfd\xe1\x7f\x56\x18\x8c\xf8\xa4\x5e\x8e\xd5\xed\xca\xe9\x61\x79\x0d\x81\xb9\x95\xaa\x2e\x9d\x5e\x40\xcd\x8c\xe7\x4c\xd5\xe2\x08\x05\x87\xcc\x23\x03\x41\x1e\x13\x1c\x5b\xa7\xb9\xa5\x48\x7a\x29\x7e\xe3\x77\xbf\x10\x9b\xa6\xb7\xd3\x9c\xf4\x3c\xcf\x8d\x00\xcf\x39\xe0\xe5\xe3\xe0\x78\xa1\xdf\xc1\x30\x14\xae\xb4\x82\x8a\x0e\x6d\x39\xc2\x68\x2f\x85\xc2\x62\xb3\x52\xeb\xfd\xc0\x04\xb4\x55\x10\xf4\x9b\x5b\xeb\x88\xe9\xce\x49\xab\x54\x83\x63\x63\x77\xf4\xbf\xb3\x33\xa8\x78\x61\x04\xc1\x50\xcc\x19\x81\x57\x43\x45\x14\x85\xab\x89\xe9\x65\x13\x8c\xe6\x1a\x83\x76\xa0\x4f\xdf\x3d\x0f\x53\xae\xeb\x81\xcf\x55\xce\x33\xda\xa7\xdc\xae\x0e\x7a\x80\x9e\x06\x9e\x9f\xab\xa3\x66\xb2\x4f\xbf\x10\xba\x0f\x53\xcb\x83\xe4\x73\x35\x73\x7c\x46\xca\x59\x2d\x0a\xac\x06\xc7\x63\xf8\x01\xfe\xef\x84\x39\x00\xd1\x45\x68\x00\x70\x11\xcd\x4b\x2e\xa5\x86\xaa\xb0\x62\x4e\xe1\xb5\x9c\xfb\x16\x2f\xd3\x9f\x6b\x5e\x6d\x6b\x44\x7f\xb1\x95\x3f\xeb\xd8\x92\x51\x54\x95\x03\x58\x27\x0c\xa0\x6b\x88\xd2\xd0\x63\x0b\x27\x6c\x5c\x0c\x96\xe4\xab\x2a\x68\x6b\x3c\x3f\xa2\x28\x07\x52\xa2\x8e\xc9\xe5\x45\x37\x9b\x1c\x09\xed\xc6\x49\x3b\x31\xb6\x17\x67\x8d\x3c\xef\x87\x8b\x5a\xc8\xce\x50\x0d\x34\x6c\xb0\xd5\x35\x69\x3d\xcd\xf3\x05\xd7\xed\xc1\xe5\x36\xc8\x6c\x85\x84\x0e\x47\x58\x3d\x12\x1b\x39\x1e\xe1\xa0\x6f\xee\x0d\xbe\x80\xae\xcd\x7e\x3c\xd8\x77\x33\xec\x80\x99\x03\x63\x3d\x28\xec\xaa\x3d\x81\x52\xf7\x5c\xba\x2d\x95\x34\x91\x45\x5f\xe3\x18\xdb\x4b\x06\x58\x0c\xb7\x7a\xea\xc3\xb6\x82\xbc\xde\x36\x35\x25\xb5\xe8\x6c\x65\x48\xdd\xca\x01\x58\xa0\x7f\x74\xf9\x43\x53\x21\xd6\x49\xf3\xd3\x99\xbf\xd0\x4c\xcc\xda\xd6\x80\x1b\x2d\xe5\x96\xaa\xcd\xc7\x21\xed\x48\x22\x1b\x89\x36\x81\xa6\x1f\x71\xe9\xfe\x47\x23\x25\xcb\xf0\x69\xd3\xe7\xca\xee\x4c\x19\xe3\x88\xe1\x17\x6f\xe2\x1e\x46\x86\x1a\x86\xb3\xf1\x2e\x15\x7b\x1a\x17\x71\x63\xb0\x77\x2b\xdd\x36\x13\x9b\xef\x34\x23\xbf\xa4\xe6\xc4\x2e\x86\x6d\xcd\xc3\xb7\x8d\x43\x21\xc7\xd4\xaa\x1f\x0c\x8a\x43\x7c\xe8\xcf\xda\xfe\xed\xdb\xd4\xb0\x80\xfc\xfd\x71\xaa\x76\x4a\x7d\x5f\x33\x77\xb4\x63\xca\x26\x94\x13\x95\xfe\xca\x27\xbb\x9e\x3d\x59\x1e\x5d\x33\xee\x2b\x63\xd0\xcf\xbf\x5e\x0e\x9e\x83\xaf\x84\x3f\x13\x28\x55\x5f\x02\x81\x22\x83\x2a\x28\xd5\xb8\x06\x06\x92\x07\x3b\xe7\x45\x41\xe0\xc4\x69\x46\xf9\x87\x0c\x1c\x17\x46\x78\xc3\xed\xab\xc3\xe5\xd9\x36\x81\xce\xb9\x43\x87\x94\x89\x6c\x78\xc9\xdc\xf0\x53\xc2\x30\x37\xfc\x15\xfe\xe5\x72\x23\x94\x73\x70\x6e\x74\xb3\x90\xcf\x8d\xe1\x34\xf5\xf5\xd4\xf0\x0c\x5e\x20\x35\x06\x92\xff\xdb\xd4\x08\xbe\x8a\x7c\xcf\xd4\x70\x23\x50\x30\x5e\x84\xdf\xb6\xba\xcc\xe8\xee\xf4\xdf\x38\x62\xf4\x62\x26\xe7\x8b\x28\x14\x9a\xc0\x5d\x5d\x17\x76\x88\x70\x63\xd8\xd8\x59\xfe\xdb\x5c\xac\x87\x40\x3f\x95\x8d\xc9\x74\x93\x73\x6c\xdf\x31\xc2\xf7\xc8\x8f\x7a\x93\x53\x66\xf7\xc1\x6f\x30\x58\xf6\xde\xa3\xc6\xc0\xc8\xa7\x8e\xc5\x2a\x01\xea\x10\xa7\x53\xa1\xf4\x8c\x6e\x02\x63\x6f\xfb\x40\x98\x93\x3a\x00\x87\x3b\x70\x6c\x88\xf7\xcf\x58\xba\xff\xb8\x39\xb0\x62\x0f\x19\x04\x5f\x3f\x3f\xe2\xe3\x55\xdd\x2a\x76\x57\xa0\xfb\x10\x3a\xe1\x7c\x8d\x13\xc9\x98\x63\xa2\xc5\xf5\xb3\xb4\x46\xf9\xad\xd9\x7e\x9f\xcb\x47\xf5\x1d\xe6\x44\xbc\xe7\xc2\xb0\xf5\x49\x66\xaf\x98\x9b\x60\xbe\x71\x55\xd8\x7f\xa9\x21\xdb\x87\x35\x38\x61\xba\x73\xda\x84\xf5\xd3\x77\x94\x78\x58\x89\x87\x6b\xf6\x1d\x95\x99\xf8\x8a\xe6\x21\xe1\xdf\x00\x00\x00\xff\xff\x39\x4c\x24\xb1\x74\x19\x00\x00") +var _templates_server_builder_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xcc\x59\x5b\x6f\x1b\xbb\x11\x7e\xae\x7e\xc5\x40\x48\x8a\xdd\x40\x91\xfc\x58\x18\x70\x01\x37\x49\x11\xb7\x4d\x6a\xd8\x4e\xf3\x60\x18\x05\xbd\x4b\x49\xac\xf7\x16\x92\x6b\x55\x35\xf4\xdf\x3b\xc3\xcb\x2e\x57\xbb\x52\x24\xdb\xc1\x39\xc1\xc1\xc9\x8a\x1c\xce\x7c\x73\x1f\x32\x15\x4b\x1e\xd8\x82\xc3\xd3\xd3\xf4\xd2\x7e\x6e\x36\xa3\xd1\x6c\x06\x37\x4b\xa1\x60\x2e\x32\x0e\x2b\xa6\x60\xc1\x0b\x2e\x99\xe6\x29\xdc\xaf\x41\x2f\x39\xa8\x15\x5b\x2c\xb8\x04\x5d\x96\xd9\x94\xe8\x3f\xa5\x42\x8b\x62\x81\x9b\xfe\x5c\x2e\x16\x4b\x0d\x95\x2c\x1f\x39\xcc\x6b\x6d\x58\x2d\x79\x01\xeb\xb2\x06\xc9\xdf\xcb\xba\xe8\x70\xf2\x22\x20\x29\xf3\x9c\x15\xe9\x68\x24\xf2\xaa\x94\x1a\xa2\x11\xc0\x58\x69\x89\xdc\xd5\x98\xbe\x0b\xae\x67\x4b\xad\x2b\xf3\x63\x21\xf4\xb2\xbe\x9f\xe2\xa1\x59\xc2\x54\xcd\xb2\xff\x88\x7c\xb6\x28\xdf\x3b\xb6\x87\xd0\xcc\x54\xc5\x93\xc3\x08\xb5\x9c\xe7\xfa\x20\xd2\x5c\xa4\x69\xc6\x57\x4c\xf2\x23\xc9\x67\x8a\x27\xb5\x14\x7a\x3d\x1e\xe1\xc1\xa7\x27\xc9\x0a\xf4\xcf\x9b\x07\xbe\x9e\xc0\x9b\x47\x96\xd5\x1c\x4e\xcf\x60\x7a\x61\x8c\xa3\xd0\x5b\x44\x44\xdb\x9b\x0d\x7e\xa0\xbd\x45\xa1\xe7\x30\x7e\xfb\x63\xec\xc8\x1d\x09\x2f\x52\xfc\x8a\x8d\x73\xbf\xf2\x15\x3a\xfc\xbc\xaa\xbe\xb2\x1c\xf7\xcf\x2f\x2f\x20\x91\x1c\x8d\xaf\x80\x41\xc1\x57\x10\xee\x82\x28\x94\x66\x45\xc2\x47\xf3\xba\x48\x06\xce\x46\x64\x3f\x78\x47\xff\x9f\x7e\x2c\x93\x3a\xe7\x85\x8e\xe1\xdd\xb6\x84\x27\x03\x63\x7a\xc5\x13\x2e\x1e\xb9\x74\xcc\x51\x97\x3f\x6e\x51\x12\x21\x00\xb1\x3b\x05\xff\x35\x31\x6b\x4b\x8c\x8b\x8c\x4b\x75\x0a\x39\x7b\xe0\x51\xce\xaa\x5b\x1b\x18\x77\x14\x0f\xd3\xcf\x76\x3b\xb6\xc4\xf3\x52\xe6\x4c\x23\x2d\x58\xb7\x4d\x3f\xf2\x39\xab\x33\x4d\xbb\x9b\xd1\x10\x18\x74\x4f\xa1\xf9\x7f\x35\x9c\x01\xb4\x0e\x99\xa2\xc6\x57\x65\xad\xd9\x7d\xc6\x3f\x58\x02\xa3\xf1\xa4\xcf\x60\x02\x85\xc8\x62\xe2\x2d\xb9\xae\x65\xd1\xa7\x18\xd9\xec\xea\xd9\xe6\x69\x7a\x51\xcc\x4b\x84\xa8\x12\x29\x2a\x2d\xca\x02\x69\xf5\xba\xe2\x3d\x52\x54\xa6\x4e\xb4\xb1\xa6\xb1\x7b\xfb\xa7\xeb\x01\xdc\xf7\xea\xf8\xfd\x40\x27\xa7\xc8\xa8\xb5\xa9\x23\xda\x61\xd3\x51\x63\x4f\xcf\xcd\x19\xf5\x8a\x2f\x04\x7e\xae\x83\x58\x25\xe6\x0a\x31\x60\x70\x5a\x55\x3f\x64\x4c\x29\xab\x81\xdb\x92\x68\x20\x3a\x47\x72\x19\xe1\xb4\x8b\x28\x02\x7f\x8e\xf1\xc8\x17\x9e\x0a\x76\x83\xfa\x6f\x36\x63\xf4\x45\xce\x81\x8c\x61\x9d\x36\xc4\xce\xe5\x91\x17\x2d\x83\x90\x0f\x80\x5d\xca\x32\xad\x93\x41\x60\x6e\xab\x0b\xac\xf2\x8b\x47\x03\x6b\xd8\x79\x60\x7e\x61\x18\xd8\xb5\xcb\x79\x0c\x51\x51\x08\x72\xbf\xcf\x6c\x31\xc7\x5c\x57\x7f\x61\x4a\x24\xe7\xb5\x5e\x0e\x20\xa7\xe5\x0e\x6a\x4a\x53\x62\x81\xe5\x95\x69\xd0\x98\x29\x0a\x6a\xc5\x65\x81\xe4\x80\xee\x84\x0a\xcf\xae\x4a\x99\x9a\x1f\x36\x52\xad\xb6\xa2\x48\x44\xc5\x32\x14\x8c\x52\x04\x16\x6f\x2e\xc9\xeb\xb8\x89\x32\x30\xa6\x44\xc2\x0c\xe3\x15\x56\x33\xb8\x27\x4c\x66\xa7\xa7\xbd\x81\x44\x30\x22\x1b\x4a\x13\xb0\x7f\xc7\x10\x51\xa3\xf1\x72\x28\x61\xb8\x94\xa5\x8c\x5b\xab\x78\x8d\x31\xd4\xff\xce\xd7\x2f\x51\x99\x61\x73\x7a\xc0\x7e\xf3\x5c\x25\x51\x3f\xec\x77\x25\x31\x00\x56\x09\xc0\x12\x4b\x30\x5c\xdd\xa2\xbe\x26\x52\x24\x10\xb6\x8d\xe1\xce\x75\x59\xcb\xc4\x97\xdb\x7d\xe6\x38\xc0\x0c\xc3\x61\xf2\xcf\x8a\x5a\xa4\x8d\x8e\x9e\x51\x5c\xa6\x82\xe2\x98\xa4\x04\xa9\xf4\xd4\x3e\xc7\x4d\x18\x3b\xb0\x9f\x6b\x6c\xb2\xc1\xe9\x96\xba\x09\xbb\x66\x20\x18\x96\x13\x8e\x0c\xd3\x41\x12\xab\x44\xa6\xf6\xb1\xd8\x75\xaa\x67\x04\xd4\xf7\x9a\xcb\x47\xfe\x89\x2c\x05\x38\x64\x24\x2c\xcb\xd0\xfe\x66\xa6\x40\x17\x71\xbf\x2e\x6d\xc1\x4d\x27\xa4\xaa\xe4\xb4\xc4\x20\xb5\xb5\xdf\x5b\xc2\xf2\xbb\xaf\xb5\x99\x46\x12\x3c\x8e\x56\xa3\x6f\x09\xe5\xca\xc5\x37\x4d\x32\x48\x17\x08\x35\x5d\x85\xdc\x68\x2a\xe3\x15\x57\x15\x7a\x82\x7f\xc7\xc4\xe5\x72\x02\xef\xdc\xea\x8f\x9a\x2b\xdd\x78\xd4\xd6\xfb\xbf\xba\xda\xe9\xe3\x90\x9c\xe0\xe3\x17\x75\xb0\x61\xe1\x2b\xac\xed\xb3\x51\xbf\x57\x6e\xb7\xd4\xd8\xf3\x8d\xe2\xed\x72\x8c\xfd\xe1\x0f\xbb\x7a\xd0\xd4\xcb\xb1\xd8\xae\x1c\x0e\xcb\xab\x5b\x98\x6b\xa5\xcb\xdc\xe1\x02\x9c\x26\x44\xca\x74\x29\x8f\x00\xd8\x65\x1e\x99\x12\xe4\x6b\x82\x63\xeb\x90\x5b\x8a\x49\x2b\xc5\x6f\xfc\xcb\x2f\xc4\xc3\x23\x84\x57\x67\x7a\x9e\xa6\x46\x80\xe7\x1c\xf0\xf2\x7e\x70\xbc\xb8\xdf\xe1\xa1\x2b\x5c\x6a\x05\x19\x1d\xea\x72\x84\xd2\x5e\x0a\xba\xc5\x46\x25\xe1\x7e\x64\x12\xea\x22\x70\xfa\xed\x9d\x35\xc4\x70\xe7\xc4\x55\xcc\xc1\xbe\xb2\x3b\xfa\xdf\xd9\x19\x8d\x1e\x60\x47\xa7\x8e\x98\x33\x2c\x5e\x15\x26\x51\x14\xae\x4e\x4c\x2f\x1b\x60\x34\x8e\xcd\x74\xf4\x93\xee\x79\x18\xb8\xa6\x07\xbe\x14\x9c\x67\xb4\x0f\xdc\xae\x0e\x7a\x00\x4e\x53\x9e\x5f\x8a\x91\x98\xec\xc3\x17\x96\xee\xc3\x60\xf9\x22\xf9\x52\x64\x8e\x4f\x0f\x9c\x45\x91\xf1\xa2\x73\x3c\x86\x3f\xc3\x89\x13\xe6\x0a\x08\x25\xa1\x29\x80\xf3\x68\x9c\x0b\xa5\xa8\x54\x85\x19\x73\x0a\x6f\xd5\xd8\xb7\x78\x35\xfd\x5b\x29\x8a\x6d\x44\xf8\x5f\x1c\xfb\xb9\xdb\xb1\x45\xa5\x30\x2b\x3b\x65\x1d\x6b\x00\xde\x03\x35\x95\x1e\x9b\x38\x61\xe3\x62\xb0\x40\x5b\x15\x41\x5b\x13\xe9\x11\x49\xd9\x91\x12\x35\x4c\x2e\x3e\x36\xb3\xc9\x91\xa5\xdd\x18\x69\x67\x8d\x6d\xc5\x59\x25\xcf\xdb\xe1\xa2\x94\xaa\x51\x94\x0a\x0d\xeb\x6c\x35\x4d\x9a\xa6\x79\x31\x17\xd4\x1e\x5c\x6c\x83\x4a\x96\x1c\xab\xc3\x11\x5a\xf7\xc4\x46\x8e\x47\x38\xe8\x9b\x7b\x83\x4f\xa0\x6b\xb3\x1f\x77\xf6\xdd\x0c\xdb\x61\xe6\x8a\x31\x0d\x0a\xbb\x72\x4f\x72\x45\x3d\x17\xaf\x78\xdb\xd7\xb5\x41\x8e\xb1\xbd\x64\x80\xad\xe1\x16\x27\x1d\xb6\x19\xe4\x71\xbb\xdb\x21\xb6\xe8\x64\x69\x48\xdd\xca\x01\xb5\x80\xfe\xe0\xed\x9b\x9b\x0c\xb1\x46\x1a\x9f\x8e\xfc\x85\x66\x60\xd6\xb6\x0a\xdc\x92\x94\x3b\xcc\x36\xef\x87\x69\x43\x12\x59\x4f\xd4\x13\xa8\xda\x11\x17\x2f\xe0\x38\x52\xb2\x84\x3f\x6d\xda\x58\xd9\x1d\x29\xfd\x3a\x62\xf8\xc5\x9b\xb8\x2d\x23\x5d\x84\xe1\x6c\xbc\x0b\x62\x4b\xe3\x3c\x6e\x14\xf6\x66\xc5\xdb\xe6\xc4\xc6\x3b\xce\xc8\xaf\x89\x1c\xd9\xc5\xb0\x8d\x3c\xfc\xb5\x71\x55\xc8\x31\xb5\xf0\x83\x41\xb1\x5b\x1f\xda\xb3\xb6\x7f\xfb\x36\xd5\x4d\x20\x7f\x7f\x1c\xca\x9d\x9c\xee\x6b\xe6\x8e\x76\x4c\xda\x84\x72\xa2\xdc\x5f\xf9\x54\xd3\xb3\x07\xd3\xa3\x69\xc6\x6d\x66\x74\xfa\xf9\xcf\xd3\xc1\x73\xf0\x99\xf0\xef\x09\xe4\xba\x4d\x81\x00\x48\x27\x0b\x72\xdd\xcf\x81\x8e\xe4\xce\xce\x79\x96\x61\x71\x12\x38\xa3\xfc\x0f\x15\xec\x27\x46\x78\xc3\x6d\xb3\xc3\xc5\xd9\x36\x01\xc5\xdc\xa1\x43\xca\x40\x34\xbc\x66\x6c\xf8\x29\xa1\x1b\x1b\xfe\x0a\xff\x7a\xb1\x11\xca\x39\x38\x36\x9a\x59\xc8\xc7\x46\x77\x9a\xfa\x79\x68\x78\x06\xaf\x10\x1a\x1d\xc9\xbf\x6d\x68\x04\xaf\x22\xbf\x32\x34\xdc\x08\x14\x8c\x17\xe1\xdb\x56\x13\x19\xcd\x9d\xfe\x99\x23\x46\x2b\x66\x70\xbe\x88\x42\xa1\x13\xb8\x2f\xcb\xcc\x0e\x11\x6e\x0c\xeb\x1b\xcb\xbf\xcd\xc5\x34\x04\xfa\xa9\xac\x4f\x46\x4d\xce\xb1\xfd\xc0\xb0\xbe\x47\x7e\xd4\x1b\x9c\x32\x9b\x07\xbf\xce\x60\xd9\x5a\x0f\x1b\x03\x43\x9b\x3a\x16\xcb\x09\x60\x87\x38\x1d\x72\xa5\x67\x74\x1b\x28\x7b\xd7\x3a\xc2\x9c\x24\x07\x1c\x6e\xc0\xbe\x22\xde\x3e\x7b\xde\x6a\x43\x2d\xf6\x3d\xe9\xee\x7f\xd1\xed\x9f\xdc\xff\xc6\xeb\x67\x69\xaa\xf2\x5b\xb3\xfd\x3e\x93\xef\x7f\xb8\xde\x73\x61\xd8\x7a\x92\xd9\x2b\xe6\x36\x98\x6f\x5c\x16\xb6\x2f\x35\xf6\xfd\x3e\xc8\xc1\x01\xd5\x9d\xd1\x06\xb4\x1f\xbe\xa3\xc4\xdd\x4c\x3c\x1c\xd9\x2f\x04\x33\xf0\x8a\x16\x96\x04\x33\x9f\x07\xff\xea\x41\x7e\x68\xae\x1b\xba\xc4\x41\x8a\xf6\xa9\x2a\xd0\xa3\x7b\x89\x32\xe1\xf3\xcd\xcd\x25\x1d\xa5\xe7\xa2\x7b\x4e\x4f\xaa\x29\xa4\x42\xf2\x44\x67\x6b\x7a\x34\x30\xae\xfc\x07\x5d\x7a\x8a\xf3\x22\x35\x02\xa2\xf1\xe9\x9f\x4e\x4e\x4e\xf0\xfe\xc3\x2a\x61\xef\x04\x11\x5e\x84\x8e\xbc\xb5\x60\x1a\x74\xea\xd5\x2f\xac\x19\xfb\xae\x34\xce\x11\x34\x5a\xba\x93\x51\x1c\x5a\xf3\xbb\xd0\xcb\x6f\x17\xcf\xb3\xa9\x28\x92\xac\x4e\xcd\xa9\x36\x4f\xed\x6b\xae\x39\x45\x1b\xfe\x5f\x0a\x6b\x41\xaf\xb2\x33\xf7\xf3\x7d\x2d\x5e\xee\x14\x0b\xfd\x19\xae\xf1\x07\x7f\x57\x0e\xfa\x76\xf1\xa5\xb1\xe1\xee\x84\xea\xf8\x91\x1c\xf9\xff\x00\x00\x00\xff\xff\x55\xd4\x7d\x1e\x0c\x1e\x00\x00") func templates_server_builder_gotmpl_bytes() ([]byte, error) { return bindata_read( @@ -116,7 +116,27 @@ func templates_server_builder_gotmpl() (*asset, error) { return nil, err } - info := bindata_file_info{name: "templates/server/builder.gotmpl", size: 6516, mode: os.FileMode(420), modTime: time.Unix(1424678182, 0)} + info := bindata_file_info{name: "templates/server/builder.gotmpl", size: 7692, mode: os.FileMode(420), modTime: time.Unix(1425184622, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + +var _templates_server_main_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x53\x3d\x6f\xdb\x30\x10\x9d\xad\x5f\x71\x21\x50\x40\x6a\x63\xaa\x73\x0a\x0f\x59\xda\xba\x68\x3e\x10\x27\xe8\xd2\x85\x91\x4e\x12\x13\x8a\x14\x48\xca\xaa\x21\xe8\xbf\xf7\x48\x4b\x89\xe1\x2e\x9d\x04\xdf\x3d\xbe\x7b\xef\xdd\xb9\x13\xc5\xab\xa8\x11\x5a\x21\x75\x92\xc8\xb6\x33\xd6\x43\x9a\x00\x30\x65\x6a\x16\xbe\xc6\xc5\x8f\x46\x9f\x37\xde\x77\x2c\x09\xbf\x6a\xe9\x9b\xfe\x99\x17\xa6\xcd\x0b\xe1\x7a\xa1\x5e\x64\x9b\xd7\x66\xed\x06\x51\xd7\x68\x73\xd7\x61\xc1\x92\x2c\x49\xf2\x1c\x1e\x1b\xe9\xa0\x92\x0a\x61\x10\x0e\x6a\xd4\x68\x85\xc7\x12\x9e\x0f\xe0\x1b\x84\xf9\x09\x78\x63\x14\x0f\xf8\x1b\xf1\x4a\xd5\xde\x22\x68\xe3\xa9\x0c\x66\x8f\x76\xb0\xd2\x23\xe1\x17\x2a\x51\x79\x7a\x73\x30\xfd\x09\xa1\xf4\xf0\x8c\x85\xe8\x1d\xb5\x95\x0a\x4d\x0b\x58\x4a\xef\x60\x30\xbd\xa2\x81\x08\xca\x38\x7f\x11\x86\x6c\xfd\x5c\x34\x5a\x1d\x42\x67\x19\xe2\x51\x83\xac\x22\x33\xfe\xe9\x94\x2c\xa4\x27\x40\xf0\x23\xab\x03\xac\xd7\x52\x17\xaa\x2f\x71\x1d\x02\x83\xca\xd8\xe8\x61\xd1\x10\xe7\x52\xcd\xf5\x5d\x0c\x92\xf2\x69\x85\x2e\x5d\x92\xec\x85\x5d\x9c\xfe\xd8\xdd\xdd\xc2\x06\x5e\x9c\xd1\xfc\x41\x0c\x37\xe8\x1c\x6d\x20\x1d\x47\xbe\x7b\x07\x4c\x13\x85\x57\xf5\xba\x88\x9b\x49\x33\x18\x29\xf6\x99\x60\x47\x62\x2e\x01\xad\x85\xab\x4d\x54\xc6\x6f\x71\x48\x4f\xd8\x2f\x81\xb1\x8c\xf0\xe4\x23\xa0\x2e\x36\xa0\xa5\x8a\x0c\x40\x09\xd4\xfc\xab\xf0\x24\x54\xa7\xd4\x0c\xb0\x29\xac\x34\xea\x25\x3e\xe3\xf8\x37\xa4\x10\xf6\x29\xbb\xbf\x7b\x78\x5c\x78\x62\x7b\xb3\x21\xe2\x99\xe7\x58\x00\xf6\x99\x2d\x0c\xa2\x93\x91\xa0\x0b\x51\x48\xa3\x5d\x90\x45\xae\xae\xbb\xee\x56\xb4\x38\x4d\xd7\xf7\xdb\xf4\xc4\x42\x60\x2e\x8c\xae\x64\x4d\xbb\x0e\x3d\x22\xc8\x02\x91\x92\xce\x87\x40\xdf\x3c\xd2\xed\xf1\x9f\xb1\x98\x32\x5f\x74\xec\x32\x5c\x67\x21\x54\x43\xdb\xbc\x62\xf0\x29\x8a\xc9\x92\xd5\xb9\xdf\xd5\xea\x1f\xb7\x2b\x92\xba\xaa\x5a\xcf\xef\xad\xd4\xbe\x4a\x99\x43\xbb\x97\xba\x06\x12\xfa\xbd\xa7\x65\xbd\xa9\x05\xe1\x21\x1c\xfc\x55\x9e\x7f\x70\xbf\x35\x0d\x5d\x74\xf1\xeb\xb2\xb4\x69\x16\xb5\xce\x23\x49\x64\xc0\xf2\x1d\xb1\x61\xfa\x6e\x80\x2c\x1d\x6b\xe3\x48\x48\xbe\x3d\x1e\xcf\xd3\x76\x9a\x7e\xd1\x3f\xe8\x69\x3b\x8e\xa8\xcb\x69\x22\xb2\x2f\xff\xb9\xaa\x69\x3e\x8b\xf3\xe4\xe0\xe3\x49\xf0\x67\xa9\x1f\xaf\x87\xae\xfe\xed\x51\xbc\xda\xf0\xaa\x41\x8b\xc4\xf9\x37\x00\x00\xff\xff\xe1\xa4\x2d\x0b\x07\x04\x00\x00") + +func templates_server_main_gotmpl_bytes() ([]byte, error) { + return bindata_read( + _templates_server_main_gotmpl, + "templates/server/main.gotmpl", + ) +} + +func templates_server_main_gotmpl() (*asset, error) { + bytes, err := templates_server_main_gotmpl_bytes() + if err != nil { + return nil, err + } + + info := bindata_file_info{name: "templates/server/main.gotmpl", size: 1031, mode: os.FileMode(420), modTime: time.Unix(1425186604, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -141,7 +161,7 @@ func templates_server_operation_gotmpl() (*asset, error) { return a, nil } -var _templates_server_parameter_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd4\x59\x5b\x73\x13\x3b\x12\x7e\xf7\xaf\xd0\xba\x80\xb2\x83\x99\xe4\x81\xda\x07\xd8\xec\x03\x21\x2c\xa9\x62\x59\x36\x81\xbc\x00\xb5\x28\x33\xb2\xad\x65\x6e\x91\x34\x49\x8c\xcb\xff\xfd\x74\xeb\x32\xa3\xb9\xc6\x36\x49\x9d\x3a\xe7\xe1\xe0\xd1\xa5\xf5\x75\xf7\xd7\x17\x29\xeb\x75\xc4\xe6\x3c\x65\x64\x9c\x0b\x9e\x70\xc5\x6f\xd8\x0d\x8d\x79\x44\x55\x26\xc6\x9b\xcd\x68\xbd\xe6\x73\x12\xfc\x9b\xa7\x1f\x58\xba\x50\x4b\x18\x81\x6f\x26\x04\x79\x75\x4c\xec\x42\x56\x4d\x4f\xd6\xeb\xe0\x13\xc5\x65\x33\x32\x86\xdf\x1f\xb2\x90\x2a\x9e\xa5\x9b\xcd\x78\x46\xe0\xfb\x92\xc6\x05\x3b\xbd\xcb\x05\x93\x52\x0f\xeb\x51\x4f\xfa\xf4\xb5\x16\xfe\xb7\x63\x92\xf2\x98\xac\x47\x84\x08\xa6\x0a\x91\xe2\xe8\x08\xd1\xb0\x34\xaa\x50\xd1\xbb\x41\x54\x6e\x7a\x4f\x54\x95\xf4\x9d\x50\xc1\x49\x8a\x89\xb4\x1b\x93\x9d\xdc\x03\xd1\x0f\xb3\xc5\x88\xfe\xb1\x9b\x9d\x78\xca\x93\x22\xe9\xf5\x1d\x4e\x0e\x22\x9a\xc7\x19\x55\x7f\x7f\x39\xe9\x42\x36\x75\x2e\x34\x47\xe8\xaf\xd3\xbb\x30\x2e\x24\x50\xa9\x1c\xde\xd5\xaf\x03\x78\xcd\xe4\xef\xe2\x75\x47\x34\xf0\xba\xe1\xdd\xf0\x16\xb1\xe2\x79\xcc\xfe\x33\xef\x81\x5c\xce\xff\x2e\x6a\xef\xa0\x9d\x10\x9e\xa6\x7d\xe6\xc4\x99\xfd\xe2\xc3\xc8\xdc\x1a\x86\xfe\xb7\xca\x36\x61\x21\x55\x96\xcc\x33\x91\x50\x55\x4b\x38\x1d\x18\xdf\xe9\x55\xf7\x58\x0f\x07\xcc\x42\xfd\x29\x95\xe0\xe9\xa2\xcf\x96\xe6\x5c\xb9\x1d\xf8\x0a\xb4\x8c\x79\xd8\x95\x1e\x3f\x32\x16\xc9\x0b\xfe\x8b\xe9\x11\xc0\x28\x68\xf2\x91\x26\xf0\x89\x83\xa8\x0b\x4f\xd1\xb3\x31\x4b\xbb\x11\x4d\xdb\x11\x7b\xa6\x58\x22\x7b\x43\x56\xcf\xde\xe7\xb7\x06\x0e\x17\xa8\x56\xf2\xae\x21\x39\x04\xc8\xce\xee\x05\xa8\x94\xbc\x13\xa0\x2f\x29\xbf\x2e\xd8\x00\x26\x6f\xc1\xce\xfc\xfe\x8b\xc7\x56\x2e\xb2\x9c\x09\xb5\xea\x60\xea\x99\xfc\xe4\xca\x3c\xee\x00\xeb\xe4\x31\x40\xed\xac\xfe\x24\xc0\x25\xbe\xaa\x67\xf2\x44\x87\xad\x89\x33\x28\x45\x75\x19\xdd\x31\xdd\x29\x26\x4b\x15\x05\xac\x0d\x01\x8d\xf8\xaa\xef\x6c\x28\x79\xc5\xd3\xa8\x04\x3d\xee\x5a\xa1\xa5\xe1\x32\xe6\x19\x00\x28\xc8\x52\x85\xcb\x82\x33\x98\xb9\xbb\xa4\x80\x21\x44\xb7\x15\x8a\xc7\xc1\x45\x1e\x73\xf5\x66\x65\x14\x34\xbe\xc3\xf5\xfe\xda\xaf\x5d\xa3\xdf\x8d\x77\x4f\xb2\x38\x66\x21\xfa\xb7\x4c\x45\x3a\xb4\x63\xc9\xba\x8e\x14\xf4\xb6\xd2\xcf\x9b\x94\xbf\x70\x56\x42\x88\x8c\x6e\xa8\x20\xb5\x39\xfd\xf9\x79\x95\xb3\xe6\xa6\x4b\x4b\xbb\xd3\x98\x25\x00\x0e\x25\xcc\x8b\x34\x9c\xd4\x16\x61\x22\xd2\x0c\x3b\x59\xf2\x38\x6a\xb3\xaf\x9a\x32\x47\x4c\xc9\x01\x90\x2d\x13\x32\xb0\xe2\x61\x95\x66\x62\x9d\x3b\x4d\xbe\x11\x23\x04\x20\x96\x9c\x05\x0a\x03\x67\x47\xc0\x8e\xba\x3e\x88\xf3\xe8\x75\x63\xec\x1f\xa4\x61\x8f\xc6\x82\xe7\xcf\x2d\x08\x70\x29\x08\xb4\x90\x5b\xf4\xac\x26\x6a\xac\x47\x1e\x98\x09\xe0\xe1\x0d\x20\x47\x1e\xde\xa0\x29\x66\x2e\x86\x4b\x33\x78\x2b\xea\x96\xd4\x3c\xf0\x08\x30\x05\x3c\x36\x07\x78\x01\xeb\x87\x2c\x5a\xf1\x2c\xd5\x46\x42\xe3\x4e\xca\x33\x06\x6b\x9a\xef\x0d\x93\x32\x86\x31\x80\x8d\x4b\x20\x46\x91\x5e\x8a\xd4\x15\x1a\xa2\x45\x3b\x13\xd5\x72\x11\x9e\x4a\x9a\x34\x3d\x26\x34\xcf\x81\xdc\xf5\x53\xc4\x8c\x68\x4b\x4f\xf5\x06\x13\x18\x5a\xdc\xde\x90\x07\xcc\xd1\x81\xba\x81\x7b\x37\xe4\xc3\xa7\x95\x09\x08\xb5\x22\x15\xc9\x6a\xe9\xae\x11\x3a\x7e\x8e\xf2\x83\xe6\xb7\x5d\xe8\xe1\x7e\x0c\x33\xb4\x0f\x71\x89\xac\x4c\xc4\x39\x0d\x7f\xd2\x05\x33\x75\x5f\xff\x84\xd9\xd1\xe1\x21\xf9\xbc\xe4\x92\xcc\x79\xcc\xc8\x2d\x95\x64\xc1\xc0\x2e\xa0\x50\x44\xae\x56\x44\x2d\x19\x91\xb7\x74\xb1\x80\xd8\x55\x59\x16\x07\xb8\xfe\x34\x82\xc8\x4d\x17\x30\xe9\xf6\x25\x7c\xb1\x54\x04\xd2\xce\x0d\x83\x1c\xa7\xb4\xa8\x25\x4b\xc9\x2a\x2b\x40\xaf\x17\xa2\x48\x6b\x92\xdc\x11\x24\xcc\x92\x84\xa6\xd1\x68\xc4\x93\x3c\x13\x8a\x4c\x40\xe9\x71\xca\xd4\xe1\x52\xa9\x7c\x8c\x1f\x0b\xae\x96\xc5\x55\x00\x0b\x0f\x43\x2a\x0b\x1a\xff\x9f\x27\x87\x8b\xec\x85\x15\xb5\xcd\x9a\x43\x13\xea\x5b\x2d\x4d\x78\x14\xc5\xec\x16\xaa\x89\x86\x80\xaa\xc0\x46\xed\x0a\x41\x53\x30\xde\x93\x9f\x6c\x35\x23\x4f\x74\xc8\x20\x17\x82\x33\x8d\x5c\x5a\x22\xe1\xb4\x4e\xda\x60\x0c\xc8\xec\x73\x32\x7e\x7a\x3d\xb6\xcb\xed\x12\xe3\x95\xa9\xb6\x3c\x3a\x2e\xa6\x52\x9a\x16\x4c\x77\x63\x12\x8c\xa2\xc9\x29\x09\x8d\x63\x6d\xb6\xab\xac\x48\x23\x92\x9b\x59\xcc\xd7\x38\x08\x5b\xdf\x17\x60\x3c\x6f\x3f\xc1\xac\xaf\x93\x15\xca\x56\xab\x9c\x87\x20\x42\x3b\x11\xf8\x0f\x3a\x91\xec\x4a\xd3\x3e\x22\x73\x91\x25\x84\x12\xd4\x31\x38\x67\xd0\x97\x49\x35\x82\x0d\xac\x1b\x11\xf4\xee\x45\xa8\x6c\x86\x37\x76\x30\xad\xa3\x74\xd9\xfb\x2d\x93\xa1\xe0\xb9\x49\x94\x46\xb1\xda\x90\x53\x5b\x73\xfa\x93\x2d\x4f\x16\x75\x55\x3e\x2b\xf3\x18\x62\xbe\x81\x38\xb4\xe8\xc0\x08\x6a\x49\x30\x30\xc1\x2e\x60\x0d\xd7\xd3\xc1\x17\x30\x4c\x2f\x99\x11\xae\x08\x40\x2f\x12\x18\x55\x4b\xaa\x90\x5e\x70\x39\xbb\x43\xa2\xa6\x0b\x49\x38\x7e\xe9\x52\x4c\x89\x0d\x5b\x7a\x15\xb3\x09\xa8\x37\x4f\x14\xd8\x61\xc1\xe1\xe7\x6a\x6a\x6a\x03\x56\x66\x26\xe6\x34\x64\x08\x05\xcd\x2e\xb5\x00\x93\x2e\x25\x1e\x76\xcb\xc1\x43\x05\xd8\x16\xb6\x51\x1d\x02\x09\x53\xcb\x2c\x22\x68\x77\x39\xc2\x6a\x4f\x30\x58\xcf\x59\xc8\xa0\xd4\x09\xab\xf0\x41\x97\x91\xa7\xbe\xb6\x13\x41\x0e\x7c\xdf\xcc\x88\xc8\x0a\x88\x97\x83\x8a\x9f\xd0\xa7\xab\x70\xc9\xa2\x73\x9c\x70\x90\xd1\x43\xd8\xa0\x40\x9d\x20\x5f\xbf\xeb\x31\x57\x95\x83\xf7\x54\xfe\xb7\x60\x62\xe5\x1c\x77\x2d\x75\xc7\x13\x7c\x39\xff\x10\xe8\x89\x49\x55\x02\x88\xdd\x80\x85\xdb\xad\xf7\xbc\xd3\xc5\x03\x77\x4e\x9a\xa9\x56\x43\x69\x7a\xcc\xea\xf4\xcd\xa6\x96\x4c\xeb\xe6\x09\xd0\xc9\x2d\x96\x4c\xae\x65\xf0\x2f\xa6\xaa\xee\x7d\x6a\x6d\x62\xef\x98\x1d\x57\x47\xa2\xcd\x50\x26\x4d\xf8\xd0\xdd\xc4\xb4\xac\x8e\xa5\xa6\xd0\x8e\x80\xcc\xbd\xa1\x19\x1c\xc6\x10\x8f\x09\xf2\x3d\xa3\x50\x96\xf6\x87\x19\x18\x01\x8f\x09\xb1\x24\x4c\xe5\xf6\x77\x50\x0d\xca\x21\xff\xc6\xd9\xbc\x81\x1a\x74\x65\xc7\x27\x34\x22\xdc\xed\x81\xed\xed\xe9\x3a\x00\x62\x7b\xf7\x91\xdd\x4e\x5e\x1e\x1d\x41\xe7\x26\x40\x3a\x16\x2d\x5d\xaf\xbe\x8d\xeb\x47\x7f\x1b\x93\x39\x85\x89\xe8\x15\x79\x7a\x33\x36\xea\x69\xfd\x88\xd6\xcd\x1c\xd2\xb6\x73\x3b\x97\x1d\xbb\x1a\x17\x20\xf0\xf5\x5b\xc8\x30\xaf\x48\x53\x6d\xa3\x68\x73\xdc\x8c\x6e\x6a\x56\xdd\xcf\xcd\x68\x37\xdd\x31\x3e\xac\x97\x6d\x2f\x55\xe6\x71\xcf\xed\x0f\x1e\xed\x1d\x77\xbf\x8e\x04\xd0\x77\xc3\x7b\x38\x4a\x63\xa9\xa9\xd3\xfa\x41\x74\xe9\xf3\xd1\x23\x2a\xe4\x7b\xaf\xac\x09\x67\xf2\x4d\x16\x39\x2f\xd5\xae\x29\xe6\x3c\xf0\x2b\x96\x53\xe1\x7e\x00\x70\xdc\x30\x23\xcf\xb6\x08\x86\xad\x51\xda\x40\x05\x18\x92\x9d\xe2\xe7\xa4\x11\x9e\xe3\xae\xab\x58\x7f\x98\xb6\x38\x89\xc5\xfb\x7f\x8d\xdb\x42\xbb\x2c\xeb\xfb\x7f\x6a\x1a\xe4\x7b\x03\xdd\x75\xed\x3d\xb7\x82\xb6\x08\x77\x4f\x98\xdc\xeb\xc9\x41\x6f\x9a\xff\xae\x20\x9b\xfd\xb4\x5f\x9b\x51\xf5\xff\x6d\xb2\x46\x4b\x97\x9d\xa0\x0d\x00\x2b\x21\xd8\x0c\x61\x79\xe6\x25\x0c\xfb\x0b\xd0\xe1\xc3\x2b\xec\x9e\x92\x7f\x92\xa3\xce\x7b\xf9\x09\xb4\x6e\x99\xe4\x8a\x55\xcf\x1c\x86\x1a\xb0\x2b\x08\x02\x47\xec\xfa\x5b\x06\xb4\xdd\x4f\x42\xd7\x58\xe9\xee\xbc\x6c\xb3\x88\x7e\x9d\x69\xf6\x2c\x7e\xc7\xe2\x47\x42\xf9\x8e\xe1\x3d\x54\x74\xbe\xb6\x0d\xf5\x78\x15\x94\xaa\xc7\xeb\x49\xd9\xf4\xd6\xbe\x8f\x97\x2f\xe1\xa4\xa7\x29\x2d\x5f\x59\x30\x33\x4d\x2c\xf4\xb2\x7b\x99\x12\xdd\x31\x72\xc1\x22\x9f\x04\xe5\x03\xa8\x9b\xbc\x28\x1f\xe3\x7b\x9f\x3a\x00\xd3\x96\x8f\x0c\x95\x83\xf5\x15\x7b\xe8\x05\xc7\x7b\xbb\x41\xf9\xfb\xbc\xd0\x0c\xbe\xcd\x94\xaf\x32\x56\xba\xbd\x70\xb4\x5f\xd5\x8e\x4d\x17\x5f\x7f\xf3\xe8\x59\x09\xb2\x3a\xf4\x84\xee\xb8\xa2\xa6\x1c\x0e\x39\x67\xff\xb6\xe7\x7b\xff\xee\x31\x68\xe9\x1a\xeb\xfb\x0a\xf1\xc3\x51\xf3\xeb\xf7\x1d\xc8\x29\xed\x1f\x58\x74\x84\xa3\x17\x4a\x8b\xd5\x98\xa9\x97\x1d\x1f\xf7\x44\xbf\x5b\x3a\xe0\xf0\x46\x69\xab\x8e\x79\xcb\xe6\xb4\x88\xd5\xa5\xb9\x72\x47\x6c\x7e\xe9\xee\xea\xdd\x0f\xca\xf5\xf5\x03\xcf\xc6\x9a\xac\x15\xee\x67\xcf\xb4\x8e\xee\x00\x3f\x95\xf5\x10\xc9\x2d\xad\xb7\x77\x3d\x96\x00\xe7\xfa\xa9\x74\xe8\x95\x6a\x88\xbc\xf5\xa7\x22\x9f\xbd\x17\x28\xe3\x4f\xa2\x70\x07\x87\xab\x3f\x47\x60\xde\xad\x47\x57\x0f\xde\x5d\x19\x7e\xaf\x0e\xc3\x49\x77\xf8\x7d\xbd\x33\x30\xfd\xbf\x94\x94\xff\xfe\x11\x00\x00\xff\xff\x1b\xb4\x80\xa7\xe2\x21\x00\x00") +var _templates_server_parameter_gotmpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd4\x59\x5f\x73\xdb\xb8\x11\x7f\xd7\xa7\xd8\x6a\x72\x19\xc9\xa7\xa3\xfd\x70\xd3\x87\x5c\xdd\x87\x38\xbe\xc6\x33\x69\x9a\xda\x17\xbf\x24\x99\x06\x26\x21\x09\x0d\xff\x19\x00\x6d\x2b\x1a\x7d\xf7\xee\x02\x20\x09\x52\x24\x2d\x29\xf6\x74\xee\x1e\x2e\x22\xb0\x00\x7e\xbb\xfb\xdb\x3f\x80\xd7\xeb\x88\xcf\x45\xca\x61\x9c\x4b\x91\x08\x2d\xee\xf8\x1d\x8b\x45\xc4\x74\x26\xc7\x9b\xcd\x68\xbd\x16\x73\x08\xfe\x29\xd2\x77\x3c\x5d\xe8\x25\x8e\xe0\x37\x97\x12\x5e\x9d\x82\x13\x14\x59\x5a\x0b\x4c\xd6\xeb\xe0\x03\x23\xc1\x19\x8c\xf1\xf7\xbb\x2c\x34\x12\x9b\xcd\x78\x06\xf8\x7d\xcd\xe2\x82\x9f\x3f\xe4\x92\x2b\x65\x86\xcd\xa8\xb7\xff\xf4\x37\xb3\xfd\x5f\x4e\x21\x15\x31\xac\x47\x00\x92\xeb\x42\xa6\x34\x3a\x22\x3c\x3c\x8d\x6a\x5c\xec\xe1\x11\x5c\xa5\xc0\x81\xb8\xea\xfd\xf7\xc2\x85\x27\x69\x2e\xd3\x3e\x54\x6e\xfa\x00\x4c\x5f\xed\x12\xbb\xf9\xd7\xfd\x6c\x25\x52\x91\x14\xc9\x80\x07\x69\x7a\x10\xd3\x3c\xce\x98\xfe\xeb\xaf\x93\x2e\x6c\xd3\xd2\x91\xf6\x10\xf3\x75\xfe\x10\xc6\x85\x42\x4a\x55\xc3\xfb\x7a\x77\x10\xb1\x9d\xfe\x51\xc4\xe5\x21\x2d\xc4\xe5\xf0\x7e\x88\x8b\x58\x8b\x3c\xe6\xff\x9a\xf7\x82\xae\x24\x7e\x14\xb7\x77\xd4\x5e\x18\xcf\xd3\x7e\x93\xd2\xdc\x61\x91\x62\x77\xdd\x19\x88\xf9\xb7\xce\x3d\x61\xa1\x74\x96\xcc\x33\x99\x30\xdd\x48\x3f\x9d\x28\x7f\x37\x72\x8f\x58\x90\x06\xac\xa0\xf9\x54\x5a\x8a\x74\xd1\x67\x4f\x7b\xb2\xda\x0d\x7e\x0d\x5b\xc5\x22\xec\x4a\x97\xef\x39\x8f\xd4\x95\xf8\xce\xcd\x08\x62\x94\x2c\x79\xcf\x12\xfc\xa4\x41\xd2\x46\xa4\xe4\xdd\x98\xa7\xdd\x88\xa6\xdb\xb1\x7b\xa1\x79\xa2\x06\x82\xd7\xcc\x3f\xe6\xbb\x16\x92\x32\x64\xdd\xde\xfb\x06\xe7\x30\x24\x37\x7f\x10\xa4\x6a\xef\xbd\x20\x7d\x4c\xc5\x6d\xc1\x07\x51\x79\x22\x7b\xf3\xfc\x4f\x1f\x65\xb9\xcc\x72\x2e\xf5\xaa\x83\xb1\x17\xea\x43\x59\xfe\x69\x05\xda\x27\x8f\x99\xee\xee\x0a\x20\x20\x11\x5f\xd9\x0b\x75\x66\x02\xd8\xc6\x1b\x16\xa7\xe6\x1e\xdd\xd1\xdd\xb9\x4d\x96\x6a\x86\x58\x5b\x1b\xb4\xe2\xac\xb9\xb2\xa5\xe4\x8d\x48\xa3\x0a\xf4\xb8\x4b\xc2\xec\x46\x62\xdc\x33\x00\xd2\x90\xa7\x9a\xc4\x82\x0b\x9c\x79\xb8\x66\x88\x21\x24\xc7\x15\x5a\xc4\xc1\x55\x1e\x0b\xfd\x7a\x65\x15\xb4\xbe\x23\x79\x5f\xf6\x53\xd7\xe8\x17\xeb\xdd\xb3\x2c\x8e\x79\x48\xfe\xad\x52\x92\x09\xf1\x58\xf1\xae\x23\x25\xbb\xaf\xf5\xf3\x26\xd5\x77\x9a\x55\x18\x26\xa3\x3b\x26\xa1\x31\x67\x3e\xff\x58\xe5\xbc\xbd\xe8\xda\xda\x8d\x9f\xc7\x3c\x41\x70\xb4\xc3\xbc\x48\xc3\x49\x43\x88\x12\x92\x61\xd8\xd9\x52\xc4\xd1\x36\xfb\xea\x29\x7b\xc4\x14\x8e\x90\x6c\x99\x54\xc1\x75\xc5\x6b\xc3\xc4\x26\x77\xda\x7c\x03\xbb\x09\x42\xac\x38\x8b\x14\x46\xce\x8e\x90\x1d\x4d\x7d\x08\xe7\xc9\x6f\xad\xb1\xbf\x41\xcb\x1e\x2d\x81\x9f\x7f\x76\x20\xd0\xa5\xb8\xa1\x83\xbc\x45\xcf\x7a\xa2\xc1\x7a\xe2\x81\x9d\x40\x1e\xde\x21\x72\xe2\xe1\x1d\x99\x62\x56\x46\x71\x65\x06\x4f\xa2\x69\x49\xc3\x03\x8f\x00\x53\xc4\xe3\xb2\x80\x17\xb0\x7e\xc8\x92\x15\x2f\x52\x63\x24\x32\xee\xa4\x3a\x63\xb0\xb6\xf9\xde\xb0\x29\x63\x18\x03\xda\xb8\x02\x62\x15\xe9\xa5\x48\x53\xa1\x21\x5a\x6c\x67\xa2\x46\x2e\xa2\x53\xa1\x4d\xd3\x53\x60\x79\x8e\xe4\x6e\x9e\x22\x67\x60\x2c\x3d\x35\x0b\x6c\x60\x98\xed\x0e\x86\x3c\x60\x8e\x0e\xd4\x2d\xdc\xfb\x21\x1f\x3e\xad\x4a\x40\xa4\x15\xd4\x24\x6b\xa4\xbb\x56\xe8\xf8\x39\xca\x0f\x9a\x1f\x76\xa1\x87\xfb\x39\xcc\xb0\x7d\x48\x99\xc8\xaa\x44\x9c\xb3\xf0\x1b\x5b\x70\x5b\xfb\xcd\x4f\x9c\x1d\x1d\x1f\xc3\x1f\x4b\xa1\x60\x2e\x62\x0e\xf7\x4c\xc1\x82\xa3\x5d\x50\xa1\x08\x6e\x56\xa0\x97\x1c\xd4\x3d\x5b\x2c\x30\x76\x75\x96\xc5\x01\xc9\x9f\x47\x18\xb9\xe9\x02\x27\xcb\x75\x89\x58\x2c\x35\x60\xda\xb9\xe3\x98\xe3\xb4\xd9\x6a\xc9\x53\x58\x65\x05\xea\xf5\x8b\x2c\xd2\xc6\x4e\xe5\x11\x10\x66\x49\xc2\xd2\x68\x34\x12\x49\x9e\x49\x0d\x13\x54\x7a\x9c\x72\x7d\xbc\xd4\x3a\x1f\xd3\xc7\x42\xe8\x65\x71\x13\xa0\xe0\x71\xc8\x54\xc1\xe2\xff\x8a\xe4\x78\x91\xfd\xe2\xb6\xda\x45\xe6\xd8\x86\xfa\x4e\xa2\x75\xb3\xb0\x93\x78\x22\xa2\x28\xe6\xf7\x58\x7c\x0c\x62\xd2\x1c\xcf\x31\x9e\x93\x2c\x45\x5b\xbf\xf8\xc6\x57\x33\x78\x61\x22\x8c\xa8\x13\x5c\x18\x45\x95\xe3\x1d\x4d\x9b\x1c\x8f\xb6\xc3\x42\x30\x87\xf1\x4f\xb7\x63\x27\xee\x44\xac\x13\xa7\xc6\x51\xe4\xe7\x98\x29\x65\xbb\x36\xd3\xc0\x29\xb4\xa1\xe1\xb2\x02\x16\xc7\xc6\xca\x37\x59\x91\x46\x90\xdb\x59\x4a\xef\x34\x88\x4b\xdf\x16\x68\x6b\x6f\x3d\x50\x91\x30\xba\xd2\xde\x7a\x95\x8b\x10\xb7\x30\x3e\xc7\x70\x41\x9d\x20\xbb\x31\x51\x12\xc1\x5c\x66\x09\x30\x20\x1d\x83\x4b\x8e\x8d\x9c\xd2\x23\x5c\xc0\xbb\x11\x61\xcb\x5f\x84\xda\x15\x04\x6b\x07\xdb\x6d\xaa\x32\xd9\xbf\xe1\x2a\x94\x22\xb7\x79\xd5\x2a\xd6\x18\x2a\xd5\x36\x21\xf0\xc1\x55\x33\x87\xba\xae\xb6\xb5\x79\x2c\x8f\x5f\x63\xd8\x3a\x74\x68\x04\xbd\x04\x8a\x63\xb4\x0b\x5a\xc3\xf9\x95\xe3\x17\x12\xd2\x88\xcc\x40\x68\x40\xe8\x45\x82\xa3\x7a\xc9\x34\xb1\x11\xef\x75\x0f\xc4\xeb\x74\xa1\x40\xd0\x97\xa9\xdc\x0c\x5c\x94\xb3\x9b\x98\x4f\x50\xbd\x79\xa2\xd1\x0e\x0b\x81\x3f\x57\x53\x5b\x4a\xa8\x90\x73\x39\x67\x21\x27\x28\x64\x76\x65\x36\xb0\xd9\x55\xd1\x61\xf7\x02\x3d\x54\xa0\x6d\x71\x19\x33\x11\x93\x70\xbd\xcc\x22\x20\xbb\xab\x11\x35\x07\x40\xb1\x7d\xc9\x43\x8e\x95\x51\x3a\x85\x8f\xba\x8c\x3c\xf5\xb5\x9d\x48\x38\xf2\x7d\x33\x03\x99\x15\x18\x5e\x47\x35\x3f\xb1\xb5\xd7\xe1\x92\x47\x97\x34\x51\x42\x26\x0f\x51\x3f\x83\x65\x05\x3e\x7d\x31\x63\x65\x11\x0f\xde\x32\xf5\xef\x82\xcb\x55\xe9\xb8\x5b\x65\x1a\xa4\xe0\xe3\xe5\xbb\xc0\x4c\x4c\xea\x8a\x01\x6e\x01\xd5\xf9\x52\xde\xf3\x4e\x17\x0f\xca\x73\xd2\x4c\x6f\xf5\x9f\xb6\x25\xad\x4f\xdf\x6c\x1a\xb9\xb7\x69\x9e\x80\x9c\xbc\xc5\x92\xc9\xad\x0a\xfe\xc1\x75\xdd\xec\x4f\x9d\x4d\xdc\xd5\xb4\xe3\xc6\x09\xc6\x0c\x55\x8e\xc5\x0f\xd3\x7c\x4c\xab\x62\x5a\x69\x8a\xdd\x0b\xee\x79\x30\x34\x8b\xc3\x1a\xe2\x39\x41\xbe\xe5\x0c\xab\xd8\xe1\x30\x03\xbb\xc1\x73\x42\xac\x08\x53\xbb\xfd\x77\x2c\x1e\xd5\x90\x7f\x49\x6d\x5f\x5a\x2d\xba\xaa\x41\x94\x06\x11\xad\xf6\xc0\xf6\xb6\x80\x1d\x00\xa9\x1b\x7c\xcf\xef\x27\xbf\x9e\x9c\x60\xa3\x27\x71\x77\xaa\x71\xa6\xbc\x7d\x1e\x37\x8f\xfe\x3c\x86\x39\xc3\x89\xe8\x15\xfc\x74\x37\xb6\xea\x19\xfd\xc0\xe8\x66\x0f\xd9\xb6\xf3\x76\x2e\x3b\x2d\x4b\x62\x40\xc0\xd7\x6f\x30\xc3\xbc\x82\xb6\xda\x56\xd1\xf6\xb8\x1d\xdd\x34\xac\x7a\x98\x9b\xc9\x6e\xa6\xc1\x7c\x5a\x2f\xbb\xd6\xab\xca\xe3\x9e\xdb\x9f\x3c\xda\x3b\xae\x8a\x1d\x09\xa0\xef\x42\xf8\x74\x94\xa6\x52\xd3\xa4\xf5\x93\xe8\xd2\xe7\xa3\x67\x54\xc8\xf7\x5e\x55\x13\x2e\xd4\xeb\x2c\x2a\xbd\xd4\xb8\xd5\xd8\xf3\xd0\xaf\x54\x4e\x65\xf9\x03\x81\xd3\x82\x19\xbc\xdc\x21\x18\x76\x46\xe9\x02\x15\x61\x28\x7e\x4e\x9f\x93\x56\x78\x8e\xbb\x6e\x6e\xfd\x61\xba\xc5\x49\x2a\xde\xff\x69\x5d\x2e\xb6\xcb\xb2\x79\x2e\x48\x6d\x3f\xfd\x68\xa0\x97\x4d\x7e\xcf\x25\x62\x7b\x8b\xf2\x5a\x31\x79\xd4\x93\x83\xde\xb4\xff\xdd\x60\x36\xfb\xe6\xbe\x36\xa3\xfa\xff\xbb\x64\x8d\x2d\x5d\xf6\x82\x36\x00\xac\x82\xe0\x32\x84\xe3\x99\x97\x30\xdc\x2f\x44\x47\xef\xb5\xb8\x7a\x0a\x7f\x87\x93\xce\x6b\xfc\x19\xb6\x6e\x99\x12\x9a\xd7\xaf\x22\x96\x1a\xb8\x2a\x08\x82\x92\xd8\xcd\xa7\x0f\x6c\xbb\x5f\x84\x65\x63\x65\xba\xf3\xaa\xcd\x02\xf3\x98\xd3\xee\x59\xfc\x8e\xc5\x8f\x84\xea\xd9\xc3\x7b\xd7\xe8\x7c\x9c\x1b\xea\xf1\x6a\x28\x75\x8f\xd7\x93\xb2\xd9\xbd\x7b\x56\xaf\x1e\xd0\xa1\xa7\x29\xad\x1e\x65\x28\x33\x4d\x1c\xf4\xaa\x7b\x99\x82\xe9\x18\x85\xe4\x91\x4f\x02\xef\xc5\xb4\x9c\xbe\xaa\x5e\xf1\x7b\xdf\x46\x10\xd5\x8e\xaf\x12\xb5\x8b\xcd\x9d\x7c\xe8\xc9\xc7\x7b\xec\xa1\xfd\x0f\x79\xd2\x19\x7c\xcc\xa9\x9e\x71\xdc\xee\xee\xca\xb1\xfd\x0c\x77\x6a\xfb\x78\xaf\xd4\xf6\x88\xe1\x46\x1d\x4a\x62\x73\x5c\x33\x53\x0d\x47\x5c\x79\x57\xd9\x76\x7c\xef\x5f\x4b\x06\xcd\xdc\x20\x7d\x5f\x1d\x7e\x3a\x66\x7e\xfa\xb2\x07\x37\x95\xfb\xb3\x8c\x09\x70\x72\x41\x65\xb1\x06\x31\x8d\xd8\xe9\x69\x4f\xf0\x97\xa2\x03\xde\x6e\x55\xb6\xfa\x98\x37\x7c\xce\x8a\x58\x5f\xdb\x1b\x77\xc4\xe7\xd7\xe5\x55\xbd\xfb\xf9\xb9\x29\x3f\xf0\xc8\x6c\x98\x5a\xe3\x7e\xf9\xd2\xe8\x58\x1e\xe0\x67\xb2\x1e\x22\x95\xa2\xcd\xee\xae\xc7\x12\xe8\x5c\x3f\x93\x0e\xbd\x69\x6d\x06\x38\xde\x7c\x58\xf2\xd9\x7b\x45\x7b\xfc\x9f\x28\xdc\xc1\xe1\xfa\x8f\x17\x94\x76\x9b\xd1\xd5\x83\x77\x5f\x86\x3f\xaa\xc3\x70\xce\x1d\x7e\x8d\xef\x0c\x4c\xff\xef\x2a\xd5\xbf\xff\x0b\x00\x00\xff\xff\x3e\xf9\x78\x0a\x28\x22\x00\x00") func templates_server_parameter_gotmpl_bytes() ([]byte, error) { return bindata_read( @@ -156,7 +176,7 @@ func templates_server_parameter_gotmpl() (*asset, error) { return nil, err } - info := bindata_file_info{name: "templates/server/parameter.gotmpl", size: 8674, mode: os.FileMode(420), modTime: time.Unix(1425157101, 0)} + info := bindata_file_info{name: "templates/server/parameter.gotmpl", size: 8744, mode: os.FileMode(420), modTime: time.Unix(1425183011, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -205,6 +225,7 @@ var _bindata = map[string]func() (*asset, error){ "templates/model.gotmpl": templates_model_gotmpl, "templates/modelvalidator.gotmpl": templates_modelvalidator_gotmpl, "templates/server/builder.gotmpl": templates_server_builder_gotmpl, + "templates/server/main.gotmpl": templates_server_main_gotmpl, "templates/server/operation.gotmpl": templates_server_operation_gotmpl, "templates/server/parameter.gotmpl": templates_server_parameter_gotmpl, } @@ -257,6 +278,8 @@ var _bintree = &_bintree_t{nil, map[string]*_bintree_t{ "server": &_bintree_t{nil, map[string]*_bintree_t{ "builder.gotmpl": &_bintree_t{templates_server_builder_gotmpl, map[string]*_bintree_t{ }}, + "main.gotmpl": &_bintree_t{templates_server_main_gotmpl, map[string]*_bintree_t{ + }}, "operation.gotmpl": &_bintree_t{templates_server_operation_gotmpl, map[string]*_bintree_t{ }}, "parameter.gotmpl": &_bintree_t{templates_server_parameter_gotmpl, map[string]*_bintree_t{ diff --git a/generator/operation.go b/generator/operation.go index 47ebfaa93..9d8d5790b 100644 --- a/generator/operation.go +++ b/generator/operation.go @@ -265,7 +265,7 @@ type genOperation struct { DocString string //`json:"docString,omitempty"` // - ExternalDocs string //`json:"externalDocs,omitempty"` - Imports map[string]string //`json:"imports,omitempty"` + Imports map[string]string //`json:"imports,omitempty"` // - Authorized bool //`json:"authorized"` // - Principal string //`json:"principal,omitempty"` // - @@ -281,10 +281,10 @@ type genOperation struct { QueryParams []genParameter //`json:"queryParams,omitempty"` // - PathParams []genParameter //`json:"pathParams,omitempty"` // - HeaderParams []genParameter //`json:"headerParams,omitempty"` // - - FormParams []genParameter //`json:"formParams,omitempty"` + FormParams []genParameter //`json:"formParams,omitempty"` // - HasQueryParams bool //`json:"hasQueryParams,omitempty"` // - - HasFormParams bool //`json:"hasFormParams,omitempty"` - HasFileParams bool //`json:"hasFileParams,omitempty"` + HasFormParams bool //`json:"hasFormParams,omitempty"` // - + HasFileParams bool //`json:"hasFileParams,omitempty"` // - } func makeCodegenParameter(receiver, modelsPkg string, param spec.Parameter) genParameter { diff --git a/generator/support.go b/generator/support.go index 14997a2b7..4c0d9aa90 100644 --- a/generator/support.go +++ b/generator/support.go @@ -16,15 +16,19 @@ import ( var ( builderTemplate *template.Template + mainTemplate *template.Template ) func init() { bv, _ := Asset("templates/server/builder.gotmpl") builderTemplate = template.Must(template.New("builder").Parse(string(bv))) + + bm, _ := Asset("templates/server/main.gotmpl") + mainTemplate = template.Must(template.New("main").Parse(string(bm))) } // GenerateSupport generates the supporting files for an API -func GenerateSupport(name string, modelNames, operationIDs []string, opts GenOpts) error { +func GenerateSupport(name string, modelNames, operationIDs []string, includeMain, includeUI bool, opts GenOpts) error { // Load the spec _, specDoc, err := loadSpec(opts.Spec) if err != nil { @@ -77,6 +81,8 @@ func GenerateSupport(name string, modelNames, operationIDs []string, opts GenOpt APIPackage: opts.APIPackage, ModelsPackage: opts.ModelPackage, Principal: opts.Principal, + IncludeMain: includeMain, + IncludeUI: includeUI, } return generator.Generate() @@ -93,26 +99,61 @@ type appGenerator struct { Operations map[string]spec.Operation Target string DumpData bool + IncludeMain bool + IncludeUI bool +} + +type genServerMain struct { + *genApp + IncludeUI bool + SwaggerJSON string } func (a *appGenerator) Generate() error { app := makeCodegenApp(a.Name, a.Package, a.Target, a.ModelsPackage, a.APIPackage, a.Principal, a.SpecDoc, a.Models, a.Operations) if a.DumpData { - bb, _ := json.MarshalIndent(util.ToDynamicJSON(app), "", " ") + bb, _ := json.MarshalIndent(util.ToDynamicJSON(app), "", " ") fmt.Fprintln(os.Stdout, string(bb)) return nil } + + if a.IncludeMain { + if err := a.generateMain(&app); err != nil { + return err + } + } + return a.generateAPIBuilder(&app) } +func (a *appGenerator) generateMain(app *genApp) error { + buf := bytes.NewBuffer(nil) + + jsonb, err := json.MarshalIndent(a.SpecDoc.Spec(), "", " ") + if err != nil { + return err + } + + dd := &genServerMain{ + genApp: app, + IncludeUI: a.IncludeUI, + SwaggerJSON: fmt.Sprintf("%#v", jsonb), + } + if err := mainTemplate.Execute(buf, dd); err != nil { + return err + } + log.Println("rendered main template:", "server."+app.AppName) + return writeToFile(filepath.Join(a.Target, "cmd", util.ToCommandName(app.AppName+"Server")), "main", buf.Bytes()) +} + func (a *appGenerator) generateAPIBuilder(app *genApp) error { buf := bytes.NewBuffer(nil) if err := builderTemplate.Execute(buf, app); err != nil { return err } - log.Println("rendered builder template:", app.AppName) - return writeToFile(filepath.Join(a.Target, app.Package), app.AppName+"Builder", buf.Bytes()) + log.Println("rendered builder template:", app.Package+"."+app.AppName) + return writeToFile(filepath.Join(a.Target, app.Package), app.AppName+"API", buf.Bytes()) } var mediaTypeNames = map[string]string{ @@ -148,7 +189,10 @@ func makeCodegenApp(name, pkg, target, modelPackage, apiPackage, principal strin var consumes []genSerGroup for _, cons := range specDoc.RequiredConsumes() { - cn := mediaTypeNames[cons] + cn, ok := mediaTypeNames[cons] + if !ok { + continue + } nm := util.ToJSONName(cn) if ser, ok := getSerializer(consumes, cn); ok { @@ -185,7 +229,10 @@ func makeCodegenApp(name, pkg, target, modelPackage, apiPackage, principal strin var produces []genSerGroup for _, prod := range specDoc.RequiredProduces() { - pn := mediaTypeNames[prod] + pn, ok := mediaTypeNames[prod] + if !ok { + continue + } nm := util.ToJSONName(pn) if ser, ok := getSerializer(produces, pn); ok { diff --git a/generator/templates/modelvalidator.gotmpl b/generator/templates/modelvalidator.gotmpl index 3b43ab5e0..77c2f33ae 100644 --- a/generator/templates/modelvalidator.gotmpl +++ b/generator/templates/modelvalidator.gotmpl @@ -1,47 +1,47 @@ {{define "primitivevalidator"}} {{if .Required}} -if err := validate.Required({{.Path}}, "{{.Location}}", {{.ValueExpression}}); err != nil { +if err := validation.Required({{.Path}}, "{{.Location}}", {{.ValueExpression}}); err != nil { return err } {{end}} {{if .MinLength}} -if err := validate.MinLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MinLength}}); err != nil { +if err := validation.MinLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MinLength}}); err != nil { return err } {{end}} {{if .MaxLength}} -if err := validate.MaxLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MaxLength}}); err != nil { +if err := validation.MaxLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MaxLength}}); err != nil { return err } {{end}} {{if .Pattern}} -if err := validate.Pattern({{.Path}}, "{{.Location}}", {{.ValueExpression}}, `{{.Pattern}}`); err != nil { +if err := validation.Pattern({{.Path}}, "{{.Location}}", {{.ValueExpression}}, `{{.Pattern}}`); err != nil { return err } {{end}} {{if .Minimum}} -if err := validate.Minimum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Minimum}}, {{.ExclusiveMinimum}}); err != nil { +if err := validation.Minimum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Minimum}}, {{.ExclusiveMinimum}}); err != nil { return err } {{end}} {{if .Maximum}} -if err := validate.Maximum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Maximum}}, {{.ExclusiveMaximum}}); err != nil { +if err := validation.Maximum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Maximum}}, {{.ExclusiveMaximum}}); err != nil { return err } {{end}} {{if .MultipleOf}} -if err := validate.MultipleOf({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.MultipleOf}}); err != nil { +if err := validation.MultipleOf({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.MultipleOf}}); err != nil { return err } {{end}} {{if .Enum}} -if err := validate.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { +if err := validation.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { return err } {{end}} {{end}} {{define "customformatvalidator"}} -if err := validate.FormatOf({{.Path}}, "{{.Location}}", "{{.Format}}", string({{.ValueExpression}}), formats); err != nil { +if err := validation.FormatOf({{.Path}}, "{{.Location}}", "{{.Format}}", string({{.ValueExpression}}), formats); err != nil { return err } {{end}} @@ -50,22 +50,22 @@ if err := validate.FormatOf({{.Path}}, "{{.Location}}", "{{.Format}}", string({{ {{.ParamName}}Size := int64(len({{.ValueExpression}})) {{end}} {{if .MinItems}} -if err := validate.MinItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MinItems}}); err != nil { +if err := validation.MinItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MinItems}}); err != nil { return err } {{end}} {{if .MaxItems}} -if err := validate.MaxItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MaxItems}}); err != nil { +if err := validation.MaxItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MaxItems}}); err != nil { return err } {{end}} {{if .UniqueItems}} -if err := validate.UniqueItems({{.Path}}, "{{.Location}}", {{.ValueExpression}}); err != nil { +if err := validation.UniqueItems({{.Path}}, "{{.Location}}", {{.ValueExpression}}); err != nil { return err } {{end}} {{if .Enum}} -if err := validate.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { +if err := validation.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { return err } {{end}} @@ -112,7 +112,7 @@ package {{.Package}} import ( "github.com/casualjim/go-swagger/errors" "github.com/casualjim/go-swagger/strfmt" - "github.com/casualjim/go-swagger/validate" + "github.com/casualjim/go-swagger/validation" {{range $key, $value := .Imports}} {{$key}} {{ printf "%q" $value}} diff --git a/generator/templates/server/builder.gotmpl b/generator/templates/server/builder.gotmpl index af629a21b..c56de9f93 100644 --- a/generator/templates/server/builder.gotmpl +++ b/generator/templates/server/builder.gotmpl @@ -17,6 +17,19 @@ import ( {{end}} ) +// New{{.AppName}}API creates a new {{.AppName}} instance +func New{{.AppName}}API(spec *spec.Document) *{{.AppName}}API { + {{.ReceiverName}} := &{{.AppName}}API{ + spec: spec, + handlers: make(map[string]http.Handler), + formats: strfmt.Default, + } + + {{.ReceiverName}}.context = middleware.NewRoutableContext(spec, {{.ReceiverName}}, nil) + + return {{.ReceiverName}} +} + // {{.AppName}}API {{.Info.Description}} type {{.AppName}}API struct { spec *spec.Document @@ -178,3 +191,24 @@ func ({{.ReceiverName}} *{{.AppName}}API) initHandlerCache() { {{end}} {{end}} } + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve()) +func ({{.ReceiverName}} *{{.AppName}}API) Serve() http.Handler { + if len({{.ReceiverName}}.handlers) == 0 { + {{.ReceiverName}}.initHandlerCache() + } + + return {{.ReceiverName}}.context.APIHandler() +} + +// ServeWithUI creates a http handler to serve the API over HTTP +// includes a middleware that serves a swagger ui on /swagger-ui +// can be used directly in http.ListenAndServe(":8000", api.ServeWithUI()) +func ({{.ReceiverName}} *{{.AppName}}API) ServeWithUI() http.Handler { + if len({{.ReceiverName}}.handlers) == 0 { + {{.ReceiverName}}.initHandlerCache() + } + + return {{.ReceiverName}}.context.UIMiddleware({{.ReceiverName}}.context.APIHandler()) +} diff --git a/generator/templates/server/main.gotmpl b/generator/templates/server/main.gotmpl new file mode 100644 index 000000000..ce8ec54f6 --- /dev/null +++ b/generator/templates/server/main.gotmpl @@ -0,0 +1,45 @@ +package main + +import ( + "log" + "os" + "net/http" + + "github.com/casualjim/go-swagger/spec" +) + +// This file was generated by the swagger tool. +// Make sure not to overwrite this file after you generated it because all your edits would be lost! +// It would only be overwritten if you explicitly specify --include-main for the generate all or support commands + +var swaggerJSON = json.RawMessage({{.SwaggerJSON}}) + +func main() { + swaggerSpec, err := spec.New(swaggerJSON, "") + if err != nil { + log.Fatalln(err) + } + + port := os.Getenv("PORT") + if port == "" { + port = "0" + } + + api := operations.New{{.AppName}}API(swaggerSpec) + configureAPI(api) + + listener, err := net.Listen("tcp", "localhost:" + port) + if err != nil { + log.Fatalln(err) + } + + fmt.Printf("serving {{.HumanAppName}} at http://%s\n", listener.Addr()) + + if err := http.Serve(listener, api.Serve{{if .IncludeUI}}WithUI{{end}}()); err != nil { + log.Fatalln(err) + } +} + +func configureAPI(api *operations.{{.AppName}}API) { + // configure the api here +} diff --git a/generator/templates/server/parameter.gotmpl b/generator/templates/server/parameter.gotmpl index 2deb31cc4..81e236a72 100644 --- a/generator/templates/server/parameter.gotmpl +++ b/generator/templates/server/parameter.gotmpl @@ -1,41 +1,41 @@ {{define "primitivevalidator"}} {{if .MinLength}} -if err := validate.MinLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MinLength}}); err != nil { +if err := validation.MinLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MinLength}}); err != nil { return err } {{end}} {{if .MaxLength}} -if err := validate.MaxLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MaxLength}}); err != nil { +if err := validation.MaxLength({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.MaxLength}}); err != nil { return err } {{end}} {{if .Pattern}} -if err := validate.Pattern({{.Path}}, "{{.Location}}", {{.ValueExpression}}, `{{.Pattern}}`); err != nil { +if err := validation.Pattern({{.Path}}, "{{.Location}}", {{.ValueExpression}}, `{{.Pattern}}`); err != nil { return err } {{end}} {{if .Minimum}} -if err := validate.Minimum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Minimum}}, {{.ExclusiveMinimum}}); err != nil { +if err := validation.Minimum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Minimum}}, {{.ExclusiveMinimum}}); err != nil { return err } {{end}} {{if .Maximum}} -if err := validate.Maximum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Maximum}}, {{.ExclusiveMaximum}}); err != nil { +if err := validation.Maximum({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.Maximum}}, {{.ExclusiveMaximum}}); err != nil { return err } {{end}} {{if .MultipleOf}} -if err := validate.MultipleOf({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.MultipleOf}}); err != nil { +if err := validation.MultipleOf({{.Path}}, "{{.Location}}", float64({{.ValueExpression}}), {{.MultipleOf}}); err != nil { return err } {{end}} {{if .Enum}} -if err := validate.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { +if err := validation.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { return err } {{end}} {{end}}{{define "customformatvalidator"}} -if err := validate.FormatOf({{.Path}}, "{{.Location}}", "{{.Format}}", string({{.ValueExpression}}), formats); err != nil { +if err := validation.FormatOf({{.Path}}, "{{.Location}}", "{{.Format}}", string({{.ValueExpression}}), formats); err != nil { return err } {{end}}{{define "slicevalidator"}} @@ -43,22 +43,22 @@ if err := validate.FormatOf({{.Path}}, "{{.Location}}", "{{.Format}}", string({{ {{.ParamName}}Size := int64(len({{.ValueExpression}})) {{end}} {{if .MinItems}} -if err := validate.MinItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MinItems}}); err != nil { +if err := validation.MinItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MinItems}}); err != nil { return err } {{end}} {{if .MaxItems}} -if err := validate.MaxItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MaxItems}}); err != nil { +if err := validation.MaxItems({{.Path}}, "{{.Location}}", {{.ParamName}}Size, {{.MaxItems}}); err != nil { return err } {{end}} {{if .UniqueItems}} -if err := validate.UniqueItems({{.Path}}, "{{.Location}}", {{.ValueExpression}}); err != nil { +if err := validation.UniqueItems({{.Path}}, "{{.Location}}", {{.ValueExpression}}); err != nil { return err } {{end}} {{if .Enum}} -if err := validate.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { +if err := validation.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.Enum}}); err != nil { return err } {{end}} @@ -107,6 +107,7 @@ import ( "net/http" "github.com/casualjim/go-swagger" "github.com/casualjim/go-swagger/errors" + "github.com/casualjim/go-swagger/validation" "github.com/casualjim/go-swagger/middleware/httputils" {{range $key, $value := .Imports}} @@ -187,7 +188,7 @@ func ({{.ReceiverName}} *{{.ClassName}}Params) BindRequest(r *http.Request, rout {{if not .IsBodyParam}} {{if or .IsPrimitive .IsCustomFormatter}} func ({{.ReceiverName}} *{{$className}}Params) bind{{.PropertyName}}(raw string, formats strfmt.Registry) error { - {{if and (not .IsPathParam) .Required}}if err := validate.RequiredString({{.Path}}, "{{.Location}}", raw); err != nil { + {{if and (not .IsPathParam) .Required}}if err := validation.RequiredString({{.Path}}, "{{.Location}}", raw); err != nil { return err } {{end}} @@ -196,8 +197,7 @@ func ({{.ReceiverName}} *{{$className}}Params) bind{{.PropertyName}}(raw string, return errors.InvalidType({{.Path}}, "{{.Location}}", "{{.Type}}", raw) } {{.ValueExpression}} = value - {{else}} - {{.ValueExpression}} = raw + {{else}}{{.ValueExpression}} = raw {{end}} {{if .HasValidations}}if err := {{.ReceiverName}}.validate{{.PropertyName}}(formats); err != nil { return err diff --git a/util/util.go b/util/util.go index b15f6b5e4..f5e1d1cd5 100644 --- a/util/util.go +++ b/util/util.go @@ -117,6 +117,15 @@ func ToFileName(name string) string { return strings.Join(out, "_") } +// ToCommandName lowercases and underscores a go type name +func ToCommandName(name string) string { + var out []string + for _, w := range split(name) { + out = append(out, lower(w)) + } + return strings.Join(out, "-") +} + // ToHumanNameLower represents a code name as a human series of words func ToHumanNameLower(name string) string { var out []string