RESTworld framework for HAL and HAL-Forms

Skip to first unread message

Philipp Kühn

Jan 14, 2022, 10:48:20 AM1/14/22
to HAL Discuss
Hi everyone,
I wanted to give y short notice about a framework, I developed which uses HAL and HAL-Forms.

Is is intended to offer an ASP.Net Core backend and an Angular frontend and supports mostly CRUD operation on database entities (Think of database as a service over HTTP with a frontend).
However it is flexible enough to do whatever you wish with it.

It derived from the need to have a lot of tools which are mostly used to read and write tables in the database. All of our tools had mostly the same functions, but each of them where hand written so slightly different. That's why I started developing the RESTworld framework.

The normal workflow is:
1. Frontend discovers the backend APIs and builds a menu around that.
2. User selects a menu entry and gets a (paged) list of resources of that type (mostly coming from a database table).
3. User selects one resource and gets a form where he can view, edit and delete the resource.

It consists of 

The code can be found at Github

The repository has an example project which you can run and test out.

Some notes on the HAL-Forms implementation:
I used the same endpoints as HAL, but with the HAL-Forms content type.
The Forms always have values in them, effectively treating them just as a different representation of the same resource.
However they are still linked from the HAL resource, so any HAL-Forms client should be able to detect these.

Extensions, I made to HAL-Forms:
I added object and collection property types because I often need these (at least collections) in my tools.
Both object and collection properties must have a _templates object.
Objects have a 'default' entry in the _templates object which is just an ordinary template, so it can be nested as deep as needed.
Collections have numbered entries, starting at '0' in the _templates object which are the entries of the collections. They also have a 'default' entry which serves as template for items that are added to the collection.

Some screenshots:

Index page



Edit with collection and object
edit complex.jpeg
Reply all
Reply to author
0 new messages