Skip to content

Visibility #456

@goulashify

Description

@goulashify

Hi!

Thanks for the work so far!

Are there ways to omit methods and fields during OpenAPI3 generation based on google.api.field_visibility or any plans to add support?

Example:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions