builder.addFieldsBuilder()
.setKey(fieldDefinition.key())
.setName(fieldDefinition.name())
+ .setDescription(fieldDefinition.description())
.setType(Settings.Type.valueOf(fieldDefinition.type().name()))
.setIndicativeSize(fieldDefinition.indicativeSize())
.addAllOptions(fieldDefinition.options())
.builder("foo")
.type(PropertyType.PROPERTY_SET)
.fields(
- PropertyFieldDefinition.build("boolean").name("Boolean").type(PropertyType.BOOLEAN).indicativeSize(15).build(),
- PropertyFieldDefinition.build("list").name("List").type(PropertyType.SINGLE_SELECT_LIST).options("one", "two").build())
+ PropertyFieldDefinition.build("boolean").name("Boolean").description("boolean desc").type(PropertyType.BOOLEAN).indicativeSize(15).build(),
+ PropertyFieldDefinition.build("list").name("List").description("list desc").type(PropertyType.SINGLE_SELECT_LIST).options("one", "two").build())
.build());
ListDefinitionsWsResponse result = newRequest();
assertThat(definition.getFields(0).getKey()).isEqualTo("boolean");
assertThat(definition.getFields(0).getName()).isEqualTo("Boolean");
+ assertThat(definition.getFields(0).getDescription()).isEqualTo("boolean desc");
assertThat(definition.getFields(0).getType()).isEqualTo(BOOLEAN);
assertThat(definition.getFields(0).getOptionsCount()).isZero();
assertThat(definition.getFields(0).getIndicativeSize()).isEqualTo(15);
assertThat(definition.getFields(1).getKey()).isEqualTo("list");
assertThat(definition.getFields(1).getName()).isEqualTo("List");
+ assertThat(definition.getFields(1).getDescription()).isEqualTo("list desc");
assertThat(definition.getFields(1).getType()).isEqualTo(SINGLE_SELECT_LIST);
assertThat(definition.getFields(1).getOptionsList()).containsExactly("one", "two");
// 20 is the default value
.fields(
PropertyFieldDefinition.build("text")
.name("Text")
+ .description("Text field description")
.type(PropertyType.TEXT)
.indicativeSize(10)
.build(),
PropertyFieldDefinition.build("list")
.name("List")
+ .description("List field description")
.type(PropertyType.SINGLE_SELECT_LIST)
.options("value1", "value2")
.build())
message Field {
optional string key = 1;
optional string name = 2;
- optional Type type = 3;
- optional int32 indicativeSize = 4;
- repeated string options = 5;
+ optional string description = 3;
+ optional Type type = 4;
+ optional int32 indicativeSize = 5;
+ repeated string options = 6;
}
enum Type {