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

Function Docs

dsl/api.go:203–222  ·  view source on GitHub ↗

Docs provides external documentation URLs. It is used by the generated OpenAPI specification. Docs must appear in an API, Service, Method or Attribute expr. Docs takes a single argument which is the defining DSL. Example: var _ = API("cellar", func() { Docs(func() { Description("A

(fn func())

Source from the content-addressed store, hash-verified

201// })
202// })
203func Docs(fn func()) {
204 docs := new(expr.DocsExpr)
205 if !eval.Execute(fn, docs) {
206 return
207 }
208 switch e := eval.Current().(type) {
209 case *expr.APIExpr:
210 e.Docs = docs
211 case *expr.ServiceExpr:
212 e.Docs = docs
213 case *expr.MethodExpr:
214 e.Docs = docs
215 case *expr.AttributeExpr:
216 e.Docs = docs
217 case *expr.HTTPFileServerExpr:
218 e.Docs = docs
219 default:
220 eval.IncompatibleDSL()
221 }
222}
223
224// TermsOfService describes the API terms of services or links to them.
225//

Callers 2

TestMethodFunction · 0.85
dsl_spec_test.goFile · 0.85

Calls 3

ExecuteFunction · 0.92
CurrentFunction · 0.92
IncompatibleDSLFunction · 0.92

Tested by 1

TestMethodFunction · 0.68