Created
May 31, 2019 02:24
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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