-
Notifications
You must be signed in to change notification settings - Fork 470
Allow to define HAL FORMS options based on the representation model's state #1695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There are two challenges to that:
I can see that the second point is a limitation and that we should improve on that. That said, I wonder what kind of API you'd like to see to apply representation model-specific rules to the options? We could allow users to post-process the statically computed options, but that would require us to expose API to inspect the inline and remote options. Also, we'd have to make the API work based on |
OK, understood. But why every media type has to support every affordance property? Other types than HAL-FORMS could easily ignore this property? Maybe it is already the case? I do not know how UBER oder CollectionJson, which are currently supported, handle all these possible attributes on PropertyMetadata. But maybe I am to focused on HAL-FORMS because this is the only type I am working with. |
It doesn't have to. But we can't simply add everything we see in HAL FORMS to the general affordance abstraction, as that would just create a kitchen sink of everything that every hypermedia type in the world would expose. That doesn't lead to usable APIs (in terms of Spring HATEOAS APIs) and – even more problematic – is not resulting in software reasonably maintainable.
That seems to be the case indeed. Rest assured that quite a lot of thinking went into the current arrangement to carefully balance the need of individual media types and finding decent abstractions for the source metadata. It might be worth studying the package arrangement to realize that everything specific to hypermedia types is located in the individual sub-packages of In 2, we have identified a fundamental limitation of the design of the HAL FORMS options implementation, which we can definitely work on to get resolved. Let's stick with that for this ticket. Any kind of input for the API design challenges appreciated. |
Now it is like this: Could be: Then the HalFormsOptionsFactory could offer a new withOptions method which accepts also the resource as a parameter and a HalFormsOptions creator could use the resource state to create the options. |
Could we, as a first step, provide the affordance link to Maybe it could be an additional argument to this call? Line 86 in b19f7de
Or maybe it could be added to |
At the moment options can only be added via HalFormsConfiguration for certain input classes' properties.
It would be more flexible when PropertyMetadata would support it too, because there are use cases where a class and property based approach is not sufficient:
The text was updated successfully, but these errors were encountered: