feat(derive): check form parser availability
Introduce FormValue as the parser-availability bound for #[slhx::form] models, blanket it for FromStr types, and add compile-fail coverage for a form field whose domain type lacks a parser. req: form/004 req: form/006
This commit is contained in:
+1
-1
@@ -331,7 +331,7 @@ resources. Concrete runtime targets are addressed through `ResourceRef`
|
||||
003 Handler receives `form: Form<CreateTodo>`. Validation errors target `(FormId, field_name)` or generated control ids. The runtime maps them to originating form controls via control ids derived from Surface `NodeId`, not via slot ids.
|
||||
|
||||
### req: form/004
|
||||
004 Form compatibility checks validate field presence, optionality, multiplicity, and parser availability. Domain validation remains Rust logic (`TryFrom`, custom validators, or handler code).
|
||||
004 Form compatibility checks validate field presence, optionality, multiplicity, and parser availability. Parser availability means the submitted value type implements `slhx::FormValue` (blanket-provided for `FromStr`, or explicitly implemented for custom parsers). Domain validation remains Rust logic (`TryFrom`, custom validators, or handler code).
|
||||
|
||||
### req: form/005
|
||||
005 HTML control facts are lower bounds, not complete domain semantics.
|
||||
|
||||
Reference in New Issue
Block a user