Deploying custom asset type using JSON file (not Java class) - is it supported?

Hello,

During an OpenRemote code analysis, one of our developers discovered what appears to be an undocumented way to deploy a new asset type using a JSON file placed in the “asset_model” folder inside the OR storage directory (AssetModelService.java).

I would like to ask whether this is an officially supported method for adding new asset types to the system (i.e., without the need to compile JAR files, requiring only a Manager restart after adding the JSON file), or whether we should continue using Java classes as described in the documentation. If the latter is recommended, could you explain why defining an AssetType via a Java class is preferable to using a JSON file?

Regards,
Krzysztof

Maybe @Rich is able to comment on this.
I remember people putting effort into this, but no clue whether it was finished at all.

We are looking into a way to properly “dynamically” create asset types without the need for a custom Java class.
The code you’ve seen is an old early experiment and the final solution will probably be different.

One advantage you get with a Java class is strong typing when using that asset from Java code (e.g. custom service) or Groovy rules.