Created
July 19, 2016 16:43
-
-
Save illyabusigin/52d2634f6eebecef75b2da2acf88b3ad to your computer and use it in GitHub Desktop.
Revisions
-
illyabusigin created this gist
Jul 19, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ package design import ( . "github.com/goadesign/goa/design" . "github.com/goadesign/goa/design/apidsl" ) var _ = API("test", func() { Title("test") Description("test") Host("localhost:8080") Scheme("http") BasePath("/v1/") Produces("application/json") }) var _ = Resource("test", func() { BasePath("/test") Action("show", func() { Routing(GET("/")) Response(OK, Menu) }) }) var Menu = MediaType("application/vnd.menu+json", func() { Attributes(func() { Attribute("name", String, "The name of an application") Attribute("children", CollectionOf("application/vnd.menu+json"), func() { View("nameonly") }) }) View("default", func() { Attribute("name") Attribute("children", func() { View("nameonly") }) }) View("nameonly", func() { Attribute("name") }) })