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.
()
| 131 | // transport body is fixed to a single view. The generated client collection |
| 132 | // code must project before collecting unions and body types. |
| 133 | func 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. |
nothing calls this directly
no test coverage detected