label

fun Property.label(required: Boolean, control: Control): String?

Get the label of a field from the Property or the Control with '*' if it is required. If there is no title in the Property or label in the Control, it'll return null as label.

val property = StringProperty(title = "My Label")
val control = Control(scope = "#/properties/label")
val label = property.label(required = true, control = control)

Return

label with an '*' if the field is required, null if there is no label in Control or Property

Parameters

required

Field is required or not