-
Notifications
You must be signed in to change notification settings - Fork 83
Set output_only flag for output only fields in minder protos #4951
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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:
minder/proto/minder/v1/minder.proto
Lines 3175 to 3177 in cda126f
| // 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers