You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom types not supported in HAL FORMS properties description #1697
At the moment HalFormsPropertyFactory.createProperties will convert all types not known by HtmlInputType to null.
This prevents the use of possibly new html input types and of custom types.
The HAL FORMS spec defines a set of supported types, which are all included in the HtmlInputType constants. Can you elaborate on the problem you see? Do you think we should actively reject invalid input types and consider this a programming error?
The spec doesn't define anything but the listed types supported, so we don't support any other types. I suggest asking for clarification on the spec bug tracker. I prefer to add support for stuff outside the spec after clarification. We can always loosen the constraints. Allowing something to be expressed and moving back later breaks APIs.
PropertyMetadata.getInputType()can't be of type HtmlInputType because the former is media type agnostic. That HtmlInputType is used for HAL FORMS is an implementation detail as accidentally HAL FORMS aligns a lot with the HTML spec. Other media types don't.
Edit: the reason we went for not-supporting anything but the values in the spec is this sentence in the referenced section:
It is an enumerated attribute.
Enumerated means a value within a pre-defined set of potential values. The rest of the section goes into detail how the client should behave that it doesn't understand one of the (defined) values. It doesn't specify anything about what's supposed to happen if a value not in the provided list appears.
changed the title [-]HalFormsPropertyFactory only allowes types which are implemented by HtmlInputType[/-][+]HalFormsPropertyFactory only allows types which are implemented by HtmlInputType[/+]on Nov 1, 2021
changed the title [-]HalFormsPropertyFactory only allows types which are implemented by HtmlInputType[/-][+]Custom types not supported in HAL FORMS properties description[/+]on Nov 1, 2021
Activity
odrotbohm commentedon Nov 1, 2021
The HAL FORMS spec defines a set of supported types, which are all included in the
HtmlInputTypeconstants. Can you elaborate on the problem you see? Do you think we should actively reject invalid input types and consider this a programming error?Ickbinet commentedon Nov 1, 2021
I am not sure if "possible settings" the spec means MUST or SHOULD.
HtmlInputType already supports more than these (e.g. file).
Possible solutions would be:
odrotbohm commentedon Nov 1, 2021
The spec doesn't define anything but the listed types supported, so we don't support any other types. I suggest asking for clarification on the spec bug tracker. I prefer to add support for stuff outside the spec after clarification. We can always loosen the constraints. Allowing something to be expressed and moving back later breaks APIs.
PropertyMetadata.getInputType()can't be of typeHtmlInputTypebecause the former is media type agnostic. ThatHtmlInputTypeis used for HAL FORMS is an implementation detail as accidentally HAL FORMS aligns a lot with the HTML spec. Other media types don't.Edit: the reason we went for not-supporting anything but the values in the spec is this sentence in the referenced section:
Enumerated means a value within a pre-defined set of potential values. The rest of the section goes into detail how the client should behave that it doesn't understand one of the (defined) values. It doesn't specify anything about what's supposed to happen if a value not in the provided list appears.
[-]HalFormsPropertyFactory only allowes types which are implemented by HtmlInputType[/-][+]HalFormsPropertyFactory only allows types which are implemented by HtmlInputType[/+]Ickbinet commentedon Nov 1, 2021
OK, now that it's quite clear the the type list in the spec is not exhaustive (mamund/hal-forms#88), I reopen the issue.
[-]HalFormsPropertyFactory only allows types which are implemented by HtmlInputType[/-][+]Custom types not supported in HAL FORMS properties description[/+]#1697 - Support for custom property types in HAL FORMS.
odrotbohm commentedon Nov 2, 2021
That's fixed and backported to 1.3.x.