Skip to content

Instantly share code, notes, and snippets.

@cquinn
Created May 31, 2019 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cquinn/6716fcbb87987c557c83f6da72bafce3 to your computer and use it in GitHub Desktop.
Save cquinn/6716fcbb87987c557c83f6da72bafce3 to your computer and use it in GitHub Desktop.
This Goa v3 design produces code that won't compile: ../../gen/http/items/server/types.go:42:6: NewItemResponse redeclared in this block
package design
import (
. "goa.design/goa/v3/dsl"
)
var _ = API("gbug", func() {
Server("gbug", func() {
Host("development", func() {
URI("http://localhost:8000/gbug")
})
})
})
var Item = Type("Item", func() {
Attribute("name", String, "Name of item")
})
var _ = Service("items", func() {
HTTP(func() {
Path("/items")
})
Method("listPublic", func() {
Description("List Public Items")
Result(ArrayOf(Item))
HTTP(func() {
GET("/")
Response(StatusOK)
})
})
Method("listPrivate", func() {
Description("List User-private Items")
Payload(func() {
Attribute("user", UInt32, "User ID")
})
Result(ArrayOf(Item))
HTTP(func() {
GET("/{user}")
Response(StatusOK)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment