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.
()
| 110 | // field. Client response code must therefore treat the transport body as the |
| 111 | // projected view, not the raw ResultType. |
| 112 | func 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 |
nothing calls this directly
no test coverage detected