Skip to content

Commit 80ce71d

Browse files
authored
fix: use enum instead of oneof field for input types in traits (#429)
* fix: use enum instead of oneof field for input types in traits * fix: reserve deleted field numbers to avoid usage
1 parent 434b8ae commit 80ce71d

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

raystack/frontier/v1beta1/models.proto

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,17 @@ message AuditLog {
521521
// PreferenceTrait is a trait that can be used to add preferences to a resource
522522
// it explains what preferences are available for a resource
523523
message PreferenceTrait {
524+
enum InputType {
525+
INPUT_TYPE_UNSPECIFIED = 0;
526+
INPUT_TYPE_TEXT = 1;
527+
INPUT_TYPE_TEXTAREA = 2;
528+
INPUT_TYPE_SELECT = 3;
529+
INPUT_TYPE_COMBOBOX = 4;
530+
INPUT_TYPE_CHECKBOX = 5;
531+
INPUT_TYPE_MULTISELECT = 6;
532+
INPUT_TYPE_NUMBER = 7;
533+
}
534+
524535
string resource_type = 1;
525536
string name = 2;
526537
string title = 3;
@@ -532,15 +543,10 @@ message PreferenceTrait {
532543
string default = 9;
533544

534545
string input_hints = 19;
535-
oneof input {
536-
string text = 20;
537-
string textarea = 21;
538-
string select = 22;
539-
string combobox = 23;
540-
string checkbox = 24;
541-
string multiselect = 25;
542-
string number = 26;
543-
}
546+
547+
reserved 20 to 26;
548+
549+
InputType input_type = 27;
544550
}
545551

546552
message Preference {

0 commit comments

Comments
 (0)