grpc / grpc/grpc-dotnet

gRPC FieldMask not rendered correctly in Swagger Page

Open
#2,579 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

### What version of gRPC and what language are you using?

Microsoft.AspNetCore.Grpc.Swagger v 0.8.11
C#

### What operating system (Linux, Windows,...) and version?

Windows 10

### What runtime / compiler are you using (e.g. .NET Core SDK version `dotnet --info`)

MSVC 17.9.6 / net 8.04

### What did you do?
Updated Microsoft.AspNetCore.Grpc.Swagger from 0.3.4 to 0.8.11

### What did you expect to see?
Swagger page allowing me to add repeated paths to a fieldmask.
Rendering an 'Add String Value' button and a removal option:

![swagger-01](https://github.com/user-attachments/assets/ef148d55-9bc0-4b05-b47d-32cc2f8f122e)

### What did you see instead?
Swagger page allowing only one path.

The option to 'Add String Value' has gone:

![swagger-02](https://github.com/user-attachments/assets/1952429c-44ab-4e44-8282-e8a5cb5787d5)

### Example .proto:
```
// The request message
message EntityRequest {
string EntityTypeCode = 1;
string SearchCriteria = 2;
bool ActiveOnly = 3;
google.protobuf.FieldMask mask = 4;
bool ExplicitPathing = 5;
}
```

If I create my own FieldMask type, it all starts to work again:

```
message FieldMask2 {
repeated string paths = 1;
}

...
bool ActiveOnly = 3;
FieldMask2 mask = 4;
bool ExplicitPathing = 5;
...
```
Any idea why it doesn't like the regular FieldMask?

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.