Skip to content

Commit

Permalink
Fix typos in generator and server templates
Browse files Browse the repository at this point in the history
Signed-off-by: Karsten Weiss <[email protected]>
  • Loading branch information
knweiss committed Mar 11, 2019
1 parent 1bed594 commit 8df731e
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion generator/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The general idea is that you should rarely see interface{} in the generated code
You get a complete representation of a swagger document in somewhat idiomatic go.
To do so, there is a set of mapping patterns that are applied,
to map a Swagger specfication to go types:
to map a Swagger specification to go types:
definition of primitive => type alias/name
definition of array => type alias/name
Expand Down
6 changes: 3 additions & 3 deletions generator/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ func (sg *schemaGenContext) buildProperties() error {
}
if ttpe.HasAdditionalItems && sch.AdditionalItems.Schema != nil {
// when AdditionalItems specifies a Schema, there is a validation
// check if we stepped upon an exeption
// check if we stepped upon an exception
child, err := tr.ResolveSchema(sch.AdditionalItems.Schema, false, true)
if err != nil {
return err
Expand All @@ -819,7 +819,7 @@ func (sg *schemaGenContext) buildProperties() error {
}
if ttpe.IsMap && sch.AdditionalProperties != nil && sch.AdditionalProperties.Schema != nil {
// when AdditionalProperties specifies a Schema, there is a validation
// check if we stepped upon an exeption
// check if we stepped upon an exception
child, err := tr.ResolveSchema(sch.AdditionalProperties.Schema, false, true)
if err != nil {
return err
Expand Down Expand Up @@ -1715,7 +1715,7 @@ func (sg *schemaGenContext) liftSpecialAllOf() error {
break
}
if (!tpe.IsAnonymous && tpe.IsComplexObject) || tpe.IsPrimitive {
// lifting complex ojects here results in inlined structs in the model
// lifting complex objects here results in inlined structs in the model
schemaToLift = sch
}
}
Expand Down
2 changes: 1 addition & 1 deletion generator/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ func (b *codeGenOpBuilder) liftExtraSchemas(resolver, br *typeResolver, bs *spec
// buildOperationSchema constructs a schema for an operation (for body params or responses).
// It determines if the schema is readily available from the models package,
// or if a schema has to be generated in the operations package (i.e. is anonymous).
// Whenever an anonymous schema needs somes extra schemas, we also determine if these extras are
// Whenever an anonymous schema needs some extra schemas, we also determine if these extras are
// available from models or must be generated alongside the schema in the operations package.
//
// Duplicate extra schemas are pruned later on, when operations grouping in packages (e.g. from tags) takes place.
Expand Down
2 changes: 1 addition & 1 deletion generator/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func GoLangOpts() *LanguageOpts {
// - Case 2: Symlink in target path points to location inside GOPATH. (Expanded Target Path)
// - Case 3: Symlink in target path points to directory outside GOPATH (Unexpanded target path)

// Case 1: - Do nothing case. If non-expanded paths match just genrate base import path as if
// Case 1: - Do nothing case. If non-expanded paths match just generate base import path as if
// there are no symlinks.

// Case 2: - Symlink in target path points to location inside GOPATH. (Expanded Target Path)
Expand Down
2 changes: 1 addition & 1 deletion generator/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const testPath = "a/b/c"
// Errors in CheckOpts are hard to simulate since
// they occur only on os.Getwd() errors
// Windows style path is difficult to test on unix
// since the filepath pkg is platform dependant
// since the filepath pkg is platform dependent
func TestShared_CheckOpts(t *testing.T) {
log.SetOutput(ioutil.Discard)
defer log.SetOutput(os.Stdout)
Expand Down
2 changes: 1 addition & 1 deletion generator/template_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func (t *Repository) addDependencies(templ *template.Template) (*template.Templa
if tt == nil {
tt = t.templates[dep]

// Still dont have it return an error
// Still don't have it, return an error
if tt == nil {
return templ, fmt.Errorf("Could not find template %s", dep)
}
Expand Down
6 changes: 3 additions & 3 deletions generator/templates/server/builder.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ type {{ pascalize .Name }}API struct {
Middleware func(middleware.Builder) http.Handler

// BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function.
// It has a default implemention in the security package, however you can replace it for your particular usage.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator
// APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function.
// It has a default implemention in the security package, however you can replace it for your particular usage.
// It has a default implementation in the security package, however you can replace it for your particular usage.
APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator
// BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function.
// It has a default implemention in the security package, however you can replace it for your particular usage.
// It has a default implementation in the security package, however you can replace it for your particular usage.
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator

{{range .Consumes}}// {{ pascalize .Name }}Consumer registers a consumer for a "{{ .MediaType }}" mime type
Expand Down
2 changes: 1 addition & 1 deletion generator/templates/server/server.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type Server struct {
TLSHost string{{ if .UseGoStructFlags }} `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"`{{ end }}
TLSPort int{{ if .UseGoStructFlags }} `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"`{{ end }}
TLSCertificate {{ if .UsePFlags }}string{{ else }}flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"`{{ end }}
TLSCertificateKey {{ if .UsePFlags }}string{{ else }}flags.Filename `long:"tls-key" description:"the private key to use for secure conections" env:"TLS_PRIVATE_KEY"`{{ end }}
TLSCertificateKey {{ if .UsePFlags }}string{{ else }}flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"`{{ end }}
TLSCACertificate {{ if .UsePFlags }}string{{ else }}flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"`{{ end }}
TLSListenLimit int{{ if .UseGoStructFlags }} `long:"tls-listen-limit" description:"limit the number of outstanding requests"`{{ end }}
TLSKeepAlive time.Duration{{ if .UseGoStructFlags }} `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"`{{ end }}
Expand Down

0 comments on commit 8df731e

Please sign in to comment.