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

Function oneOfResultCollectionSingleViewDSL

http/codegen/oneof_http_codegen_test.go:133–147  ·  view source on GitHub ↗

oneOfResultCollectionSingleViewDSL defines a collection result whose transport body is fixed to a single view. The generated client collection code must project before collecting unions and body types.

()

Source from the content-addressed store, hash-verified

131// transport body is fixed to a single view. The generated client collection
132// code must project before collecting unions and body types.
133func oneOfResultCollectionSingleViewDSL() {
134 animal := oneOfAnimalResultType("application/vnd.oneof-http-collection-view.animal")
135
136 Service("ServiceOneOfCollectionSingleView", func() {
137 Method("MethodListAnimals", func() {
138 Result(CollectionOf(animal), func() {
139 View("default")
140 })
141 HTTP(func() {
142 GET("/animals")
143 Response(StatusOK)
144 })
145 })
146 })
147}
148
149// oneOfAnimalResultType returns a ResultType whose default view excludes the
150// OneOf details attribute. The omitted union is the regression target.

Callers

nothing calls this directly

Calls 9

oneOfAnimalResultTypeFunction · 0.85
MethodFunction · 0.85
ResultFunction · 0.85
CollectionOfFunction · 0.85
ViewFunction · 0.85
GETFunction · 0.85
ServiceFunction · 0.50
HTTPFunction · 0.50
ResponseStruct · 0.50

Tested by

no test coverage detected