hal-forms
hal-forms copied to clipboard
HAL-Forms feature requests
As promised, here's a list of things that I think would be very great to have in HAL-Forms.
If it's more helpful to have these all as separate issues, I'm happy to split these up.
- [x] a 'target' field in each form. For us, the use of the
_htarget=
query parameter doesn't make that much sense. URIs are largely treated as opaque, and forms are server-rendered based on other contextual information. - [x] Support for a
type
property in each field, maybe just referencing the HTML5 specification for it's possible values. Also mentioned in #6. It might be helpful to mention what each 'type' serializes to. For example, acheckbox
will probably generate a JSON boolean. - [x] Support for
placeholder
,min
,max
,step
,minLength
,maxLength
- [ ] Support for an
enum
oroptions
property.options
could be used as follows:
{
"name": "color",
"options": {
"#F00": "red",
"#0F0": "green",
"#00F": "blue"
}
}
- [x] Support for multiple forms in a single document (don't limit to
default
). Also mentioned here #24
I believe all of these could be introduced without breaking backwards compatibility.
If it's helpful, the type Ketting uses to generically describe a field in a hypermedia document is here:
https://github.com/badgateway/ketting/blob/master/src/field.ts
This is how we map a HAL Forms field to Ketting field:
https://github.com/badgateway/ketting/blob/master/src/state/hal.ts#L266
@evert
thanks for submitting these -- all good additions.
i'll review the ketting links you provided to help influence the mods.
as you mentioned, i'm going to break this up into individual issues since some will be super easy and others will take a bit of work. the enum
one might be compatible with another idea i have been using for another format (called suggest). we can discuss in that issue thread.
thanks again and looking forward to getting these into place.
Awesome! Very exited =)
adding support for checkbox
, radio
, and select-options
via suggest
constuct from #6
note that this might also be a way to deal with enums
(see #38)