Loading a json config into a Form

I have an external .json-file with a valid form configuration.
How do I load this file into a form? Is it possible?
The form works if the json is embeddid in the .js-file.

In version 5 you could do something like this:

gAttestActionForm = winAttestAction.attachForm();
gAttestActionForm.loadStruct("/table_supplinvoice/attest_action_form.json");

Is this still possible? Putting the whole JSON definition in the js file is not very pretty.

You may use the AJAX to load your configuration from the external file.

Like:

dhx.ajax.get(url).then(function (data) {
const form = new dhx.Form("form", data)
})