Swagger document generated for JSON Transcoding enabled grpc server stream response, returns only single object
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
Json Transcoding correctly supports the streaming of objects when calling a gRPC server streaming method. When testing an URL directly, multiple json objects are returned.
The generated swagger document however, describes the operation as only returning a single object instead of an array of objects. When generating client code from the swagger.json file, the code also will only return a single object.
Below snippet is from the swagger.json generated by the gRPC Transcoder sample application
```
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HelloReply"
}
}
}
}
```
### Expected Behavior
Below response would generate correct client code:
```
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/HelloReply"
}
}
}
}
}
```
### Steps To Reproduce
Can be reproduced using the Transcoder sample: https://github.com/grpc/grpc-dotnet/tree/master/examples/Transcoder
### Exceptions (if any)
_No response_
### .NET Version
7.0
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.