google / google/gnostic

Visibility

Open
#456 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.3k
Forks
279
PR merge metrics
No merged PRs in 30d

Description

Hi!

Thanks for the work so far!

Are there ways to omit methods and fields during OpenAPI3 generation based on [`google.api.field_visibility`](https://github.com/googleapis/googleapis/blob/master/google/api/visibility.proto) or any plans to add support?

Example:
```protobuf
service Example {
// Treated as public.
rpc PublicExample(GetExampleRequest) returns (GetExampleResponse);

// Limited to internal.
rpc InternalExample(GetExampleRequest) returns (GetExampleResponse) {
option (google.api.method_visibility).restriction = "INTERNAL";
}
}

message GetExampleRequest {
string id = 1; // Treated as public.
string internal_val = 2 [(google.api.field_visibility).restriction = "INTERNAL"]; // Internal-only.
}
```

It would be nice to have a `selector` parameter during selection where `PUBLIC`, `INTERNAL`, etc. could be set as well, but simply hiding `INTERNAL` fields in the generation would be helpful as well for folks providing public APIs and documentation.

Would PRs be considered in this regard?

Regards,
– Dani

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.