Annotation Interface UISchema


Anotação usada para definir metadata para renderização de UI e geração de formulários.

Referenciando endpoints de Options em DTOs

Para campos que exibem opções dinâmicas (combos, autocomplete, multi‑select), use endpoint(), valueField() e displayField() para conectar a um endpoint REST e mapear o par id/label.

Padrões suportados

  1. OptionDTO (payload leve)
    
     @UISchema(
       controlType = FieldControlType.SELECT,
       endpoint = ApiPaths.Catalog.CATEGORIAS + "/options/filter",
       valueField = "id",     // org.praxisplatform.uischema.dto.OptionDTO.id
       displayField = "label" // org.praxisplatform.uischema.dto.OptionDTO.label
     )
     private Long categoriaId;
     

    O label é resolvido no backend via @OptionLabel ou heurísticas do BaseCrudService#computeOptionLabel.

  2. DTO completo (recomendado quando a UI precisa de colunas extras no dropdown)
    
     @UISchema(
       controlType = FieldControlType.SELECT,
       endpoint = ApiPaths.Catalog.CATEGORIAS + "/filter", // ✅ sempre /filter
       valueField = "id",            // campo do DTO usado como value
       displayField = "nome"         // campo do DTO usado como label
     )
     private Long categoriaId;
     

Combos dependentes (interpolação)

O endpoint suporta interpolação de parâmetros usando o valor atual de outros campos (ex.: ${estado}) para combos em cascata:


 @UISchema(
   name = "cidade",
   controlType = FieldControlType.SELECT,
   endpoint = "/api/cidades?estado=${estado}",
   dependentField = "estado",
   resetOnDependentChange = true
 )
 private String cidade;
 
 

Reidratação inicial

Para preencher selects com valores previamente salvos, consulte também GET {base}/options/by-ids?ids=... que retorna a lista OptionDTO na mesma ordem dos IDs.

  • Element Details

    • description

      String description
      Default:
      ""
    • example

      String example
      Default:
      ""
    • name

      String name
      Default:
      ""
    • label

      String label
      Default:
      ""
    • type

      Default:
      TEXT
    • controlType

      FieldControlType controlType
      Tipo de controle de UI desejado. Padrão: FieldControlType.AUTO (sentinela, indica que não houve escolha explícita pelo desenvolvedor). - Quando AUTO: o CustomOpenApiResolver aplicará detecção automática (type/format/enum) e heurísticas por nome do campo para determinar o controlType efetivo. - Quando diferente de AUTO (inclusive INPUT): é tratado como valor explícito e terá precedência sobre a detecção/heurística.
      Default:
      AUTO
    • placeholder

      String placeholder
      Default:
      ""
    • defaultValue

      String defaultValue
      Default:
      ""
    • group

      String group
      Default:
      ""
    • order

      int order
      Default:
      0
    • width

      String width
      Default:
      ""
    • isFlex

      boolean isFlex
      Default:
      false
    • displayOrientation

      String displayOrientation
      Default:
      ""
    • disabled

      boolean disabled
      Default:
      false
    • readOnly

      boolean readOnly
      Default:
      false
    • multiple

      boolean multiple
      Default:
      false
    • editable

      boolean editable
      Default:
      true
    • validationMode

      String validationMode
      Default:
      ""
    • unique

      boolean unique
      Default:
      false
    • mask

      String mask
      Default:
      ""
    • sortable

      boolean sortable
      Default:
      true
    • conditionalRequired

      String conditionalRequired
      Default:
      ""
    • viewOnlyStyle

      String viewOnlyStyle
      Default:
      ""
    • validationTriggers

      String validationTriggers
      Default:
      ""
    • hidden

      boolean hidden
      Default:
      false
    • tableHidden

      boolean tableHidden
      Default:
      false
    • formHidden

      boolean formHidden
      Default:
      false
    • filterable

      boolean filterable
      Default:
      false
    • conditionalDisplay

      String conditionalDisplay
      Default:
      ""
    • dependentField

      String dependentField
      Default:
      ""
    • resetOnDependentChange

      boolean resetOnDependentChange
      Default:
      false
    • inlineEditing

      boolean inlineEditing
      Default:
      false
    • transformValueFunction

      String transformValueFunction
      Default:
      ""
    • debounceTime

      int debounceTime
      Default:
      0
    • helpText

      String helpText
      Default:
      ""
    • hint

      String hint
      Default:
      ""
    • hiddenCondition

      String hiddenCondition
      Default:
      ""
    • tooltipOnHover

      String tooltipOnHover
      Default:
      ""
    • icon

      String icon
      Default:
      ""
    • iconPosition

      IconPosition iconPosition
      Default:
      LEFT
    • iconSize

      String iconSize
      Default:
      ""
    • iconColor

      String iconColor
      Default:
      ""
    • iconClass

      String iconClass
      Default:
      ""
    • iconStyle

      String iconStyle
      Default:
      ""
    • iconFontSize

      String iconFontSize
      Default:
      ""
    • valueField

      String valueField
      Default:
      ""
    • displayField

      String displayField
      Default:
      ""
    • endpoint

      String endpoint
      Default:
      ""
    • emptyOptionText

      String emptyOptionText
      Default:
      ""
    • options

      String options
      Default:
      ""
    • filter

      String filter
      Default:
      ""
    • filterOptions

      String filterOptions
      Default:
      ""
    • numericFormat

      NumericFormat numericFormat
      Default:
      INTEGER
    • numericStep

      String numericStep
      Default:
      ""
    • numericMin

      String numericMin
      Default:
      ""
    • numericMax

      String numericMax
      Default:
      ""
    • numericMaxLength

      String numericMaxLength
      Default:
      ""
    • required

      boolean required
      Default:
      false
    • minLength

      int minLength
      Default:
      0
    • maxLength

      int maxLength
      Default:
      0
    • min

      String min
      Default:
      ""
    • max

      String max
      Default:
      ""
    • pattern

      Default:
      CUSTOM
    • requiredMessage

      String requiredMessage
      Default:
      ""
    • minLengthMessage

      String minLengthMessage
      Default:
      ""
    • maxLengthMessage

      String maxLengthMessage
      Default:
      ""
    • patternMessage

      String patternMessage
      Default:
      ""
    • rangeMessage

      String rangeMessage
      Default:
      ""
    • customValidator

      String customValidator
      Default:
      ""
    • asyncValidator

      String asyncValidator
      Default:
      ""
    • minWords

      int minWords
      Default:
      0
    • allowedFileTypes

      AllowedFileTypes allowedFileTypes
      Default:
      ALL
    • maxFileSize

      String maxFileSize
      Default:
      ""
    • extraProperties

      io.swagger.v3.oas.annotations.extensions.ExtensionProperty[] extraProperties
      Default:
      {}