Skip to content

Latest commit

 

History

History
133 lines (126 loc) · 4.92 KB

TODO.md

File metadata and controls

133 lines (126 loc) · 4.92 KB

Swagger

swaggerToAPI() in cmd/swagger.go converts swagger.Swagger to design.APIDefinition.

  • Name
  • Title
  • Description
  • Version
  • Host
  • Schemes
  • BasePath
  • Params
  • Consumes
  • Produces
  • Origins
  • TermsOfService
  • Contact
  • License
  • Docs
  • Resources
  • Types
  • MediaTypes
  • Traits
  • Responses
  • ResponseTemplates
  • DefaultResponses
  • DefaultResponseTemplates
  • DSLFunc
  • Metadata
  • SecuritySchemes
  • Security
  • NoExamples

Templates for DSL

All goa DSL functions are generated by templates in cmd/template.go. Templates are grouped into the following three types.

  • Components that have single value
  • Components that have multiple values
  • Containers

DSL functions

  • func API(name string, dsl func()) *design.APIDefinition
  • func APIKeySecurity(name string, dsl ...func()) *design.SecuritySchemeDefinition
  • func AccessCodeFlow(authorizationURL, tokenURL string)
  • func Action(name string, dsl func())
  • func ApplicationFlow(tokenURL string)
  • func ArrayOf(v interface{}, dsl ...func()) *design.Array
  • func Attribute(name string, args ...interface{})
  • func Attributes(apidsl func())
  • func BasePath(val string)
  • func BasicAuthSecurity(name string, dsl ...func()) *design.SecuritySchemeDefinition
  • func CONNECT(path string, dsl ...func()) *design.RouteDefinition
  • func CanonicalActionName(a string)
  • func CollectionOf(v interface{}, apidsl ...func()) *design.MediaTypeDefinition
  • func Consumes(args ...interface{})
  • func Contact(dsl func())
  • func ContentType(typ string)
  • func Credentials()
  • func DELETE(path string, dsl ...func()) *design.RouteDefinition
  • func Default(def interface{})
  • func DefaultMedia(val interface{}, viewName ...string)
  • func Description(d string)
  • func Docs(dsl func())
  • func Email(email string)
  • func Enum(val ...interface{})
  • func Example(exp interface{})
  • func Expose(vals ...string)
  • func Files(path, filename string, dsls ...func())
  • func Format(f string)
  • func Function(fn string)
  • func GET(path string, dsl ...func()) *design.RouteDefinition
  • func HEAD(path string, dsl ...func()) *design.RouteDefinition
  • func HashOf(k, v design.DataType) *design.Hash
  • func Header(name string, args ...interface{})
  • func Headers(params ...interface{})
  • func Host(host string)
  • func ImplicitFlow(authorizationURL string)
  • func JWTSecurity(name string, dsl ...func()) *design.SecuritySchemeDefinition
  • func License(dsl func())
  • func Link(name string, view ...string)
  • func Links(apidsl func())
  • func MaxAge(val uint)
  • func MaxLength(val int)
  • func Maximum(val interface{})
  • func Media(val interface{}, viewName ...string)
  • func MediaType(identifier string, apidsl func()) *design.MediaTypeDefinition
  • func Member(name string, args ...interface{})
  • func Metadata(name string, value ...string)
  • func Methods(vals ...string)
  • func MinLength(val int)
  • func Minimum(val interface{})
  • func Name(name string)
  • func NoExample()
  • func NoSecurity()
  • func OAuth2Security(name string, dsl ...func()) *design.SecuritySchemeDefinition
  • func OPTIONS(path string, dsl ...func()) *design.RouteDefinition
  • func OptionalPayload(p interface{}, dsls ...func())
  • func Origin(origin string, dsl func())
  • func PATCH(path string, dsl ...func()) *design.RouteDefinition
  • func POST(path string, dsl ...func()) *design.RouteDefinition
  • func PUT(path string, dsl ...func()) *design.RouteDefinition
  • func Package(path string)
  • func Param(name string, args ...interface{})
  • func Params(dsl func())
  • func Parent(p string)
  • func PasswordFlow(tokenURL string)
  • func Pattern(p string)
  • func Payload(p interface{}, dsls ...func())
  • func Produces(args ...interface{})
  • func Query(parameterName string)
  • func Reference(t design.DataType)
  • func Required(names ...string)
  • func Resource(name string, dsl func()) *design.ResourceDefinition
  • func Response(name string, paramsAndDSL ...interface{})
  • func ResponseTemplate(name string, p interface{})
  • func Routing(routes ...*design.RouteDefinition)
  • func Scheme(vals ...string)
  • func Scope(name string, desc ...string)
  • func Security(scheme interface{}, dsl ...func())
  • func Status(status int)
  • func TRACE(path string, dsl ...func()) *design.RouteDefinition
  • func TermsOfService(terms string)
  • func Title(val string)
  • func TokenURL(tokenURL string)
  • func Trait(name string, val ...func())
  • func Type(name string, dsl func()) *design.UserTypeDefinition
  • func TypeName(name string)
  • func URL(url string)
  • func UseTrait(names ...string)
  • func Version(ver string)
  • func View(name string, apidsl ...func())