Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set output_only flag for output only fields in minder protos #4951

Open
eleftherias opened this issue Nov 12, 2024 · 0 comments
Open

Set output_only flag for output only fields in minder protos #4951

eleftherias opened this issue Nov 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@eleftherias
Copy link
Contributor

For clients using the openAPI spec, it would be useful to know which fields are only expected to be in the output and not required to be set in the input.
We can use the OUTPUT_ONLY field_behaviour flag to annotate these types of fields.

For example, by setting the field behaviour to OUTPUT_ONLY on the project field, the typescipt generated field is readonly.

message Provider {
    // ...
    string project = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

becomes:

export type v1Provider = {
    readonly project?: string;
}

We currently determine if a field is output-only by putting a comment on top of the field. For example:

// credentials_state is the state of the credentials for the provider.
// This is an output-only field. It may be: "set", "unset", "not_applicable".
string credentials_state = 9;

This task involves finding all the fields that are documented as output-only and setting the field_behaviour flag on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant