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

Function oneOfResultSingleViewDSL

http/codegen/oneof_http_codegen_test.go:112–128  ·  view source on GitHub ↗

oneOfResultSingleViewDSL defines a ResultType whose only view drops the OneOf field. Client response code must therefore treat the transport body as the projected view, not the raw ResultType.

()

Source from the content-addressed store, hash-verified

110// field. Client response code must therefore treat the transport body as the
111// projected view, not the raw ResultType.
112func oneOfResultSingleViewDSL() {
113 animal := oneOfAnimalResultType("application/vnd.oneof-http-single-view.animal")
114
115 Service("ServiceOneOfSingleView", func() {
116 Method("MethodShowAnimal", func() {
117 Payload(func() {
118 Attribute("id", String)
119 Required("id")
120 })
121 Result(animal)
122 HTTP(func() {
123 GET("/animals/{id}")
124 Response(StatusOK)
125 })
126 })
127 })
128}
129
130// oneOfResultCollectionSingleViewDSL defines a collection result whose
131// transport body is fixed to a single view. The generated client collection

Callers

nothing calls this directly

Calls 10

oneOfAnimalResultTypeFunction · 0.85
MethodFunction · 0.85
PayloadFunction · 0.85
AttributeFunction · 0.85
RequiredFunction · 0.85
ResultFunction · 0.85
GETFunction · 0.85
ServiceFunction · 0.50
HTTPFunction · 0.50
ResponseStruct · 0.50

Tested by

no test coverage detected