Skip to content

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

@eleftherias

Description

@eleftherias

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions