REST Expanders 4.0.0
Changes and improvements
Migrating to QuerySearch metamodel
Since version 3.x of rest-expanders, which was released just over a year ago, rest-expanders
has integrated with
querysearch-expanders
by using the QuerySearch metamodel. This was introduced in such a way that it was 100% backwards
compatible and also added to the model when expanding implicitly, so no change could really be observed from the
perspective of an application developer.
Today the QuerySearch metamodel has matured to the point that what currently exists of the model is stable and will no
longer have any big structural changes that are not additive. So with this version of rest-expanders
, the implicitly
added model will be removed. This means that it has to be defined in the model by the developer and coupled to the
rest-expanders
using the relevant jaxrs.querySearch
option that has been implicitly used for quite some time.
The transmuters to add default REST APIs to the model have been modified to do this automatically, so in that sense,
there will be no change to the way of interacting with rest-expanders
in the majority of cases.
DataCommand options
In rest-expanders
version 3.8.0
, options were introduced to mark the DataCommands that are to be used for the CRUD
operations in the REST API. Starting with this version, the validation to check if this has been migrated has been
removed, as well as them being implicitly added to the model. We assume that every project has been migrated by now,
but this will be the last version where the Upgrade transmutation for rest-expanders
does this migration
automatically.
Migration guide
Migration to the QuerySearch metamodel
Migrating to the QuerySearch metamodel is very easy. It was previously added based on specific rules, which have been
moved as a feature to the upgrade transmutation for rest-expanders
. Simply running this transmutation will be
sufficient to update the model and create all QuerySearch elements in such a way that it is fully backward compatible.
In µRadiant, run the "Upgrade Rest Expanders Model" transmutation on the Application model:
On command-line, you can execute the transmutation as:
mvn expanders:transmute-model -Dtransmutation=UpgradeRestExpandersModel -DtargetElement=applicationName::applicationVersion
Migration to DataCommand options
The options must be added to the relevant commands to couple them to the REST API. In the old system, the mapping was as follows and should be migrated as such:
Command name | Option |
---|---|
create<dataElement.name> | jaxrs.command.create |
modify<dataElement.name> | jaxrs.command.modify |
update<dataElement.name> | jaxrs.command.update |
remove<dataElement.name> | jaxrs.command.remove |
The upgrade transmutation for rest-expanders
can also be used to do this automatically (see
previous migration), but this will be removed after version 4.0.0
.