MCPcopy Create free account
hub / github.com/goadesign/goa / Finalize

Method Finalize

expr/api.go:177–190  ·  view source on GitHub ↗

Finalize makes sure that the API name is initialized and there is at least one server definition (if none exists, it creates a default server). If API name is empty, it sets the name of the first service definition as API name.

()

Source from the content-addressed store, hash-verified

175// one server definition (if none exists, it creates a default server). If API
176// name is empty, it sets the name of the first service definition as API name.
177func (a *APIExpr) Finalize() {
178 if a.Name == "" {
179 a.Name = "api"
180 if len(Root.Services) > 0 {
181 a.Name = Root.Services[0].Name
182 }
183 }
184 if len(a.Servers) == 0 {
185 a.Servers = []*ServerExpr{a.DefaultServer()}
186 }
187 if a.Version == "" {
188 a.Version = "0.0.1"
189 }
190}
191
192// EvalName is the qualified name of the expression.
193func (l *LicenseExpr) EvalName() string { return "License " + l.Name }

Callers

nothing calls this directly

Calls 1

DefaultServerMethod · 0.95

Tested by

no test coverage detected