Skip to content

Intent DSL cannot author a field input-validation pattern (regex), though the .edm/entity editor support widgetPattern #6336

Description

@NicoleNG18

Describe the bug

A format-constrained field (IBAN, BIC, EGN/EIK, VAT, email, phone, postcode) has no durable way to get input-validation in an intent-generated app. The entity model and modeler already carry a per-property regex — the .edm attribute widgetPattern (the modeler's "Input pattern" field) — but the intent DSL has no field pattern:, so it can't be authored via intent + Generate. The only way to set it is typing it into the modeler by hand, which is a hand-edit of the generated .edm (against the module rule) and gets scrubbed on the next Generate.

Expected: a field-level pattern: (regex) that generates the property's widgetPattern, e.g.
{ name: iban, type: string, length: 34, pattern: '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$' }
Actual: no such attribute — FieldIntent has no pattern property, IntentParser parses no pattern key, and EdmIntentGenerator never emits widgetPattern.

To Reproduce

  1. In an intent project, author an entity field that needs format validation, e.g. { name: iban, type: string, length: 34, pattern: '^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$' }.
  2. Run Generate and open the produced .edm.
  3. Note the iban property has no widgetPattern attribute — the pattern: was silently ignored (no parse error, no output).
  4. As a workaround, open the modeler and type the regex into the property's "Input pattern" field, Save.
  5. Run Generate again → the hand-typed widgetPattern is scrubbed; the validation is gone.

Expected behavior

A field's pattern: (regex) authored in the intent should generate that property's widgetPattern in the .edm (XML-escaped, matching the editor's serialization), so input-format validation is durable across regenerations and authored the same way as every other field attribute — no manual, scrub-prone modeler edit required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions