dotnet / dotnet/aspnetcore

gRPC json transcoding: Exclude fields referenced in the path from the body in swagger

Open
#55,899 0 comments 0 reactions 0 assignees View on GitHub
area-grpc
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

```protobuf
service SomeService {
rpc SomeMethod(SomeRpcMethodRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/api/{some_field}"
body: "*"
};
}
}
message SomeRpcMethodRequest {
string some_field = 1;
string another_field = 2;
}
```

### Expected Behavior

The body should be defined as the following:
```json
{ "anotherField": "string" }
```
But it includes every field in the body including "someField"
```json
{ "someField": "string", "anotherField": "string" }
```

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

8.0

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.