Thanks i just found the above link one hour ago, i'm trying to update the field definitions in the form, for example if field.type == readonly make that field as text, like field.type = text. Do you have any idea regarding this.
I usually use custom classes to implement my form definition model . You could pass in the constructor the info you have and from that apply the necesary logic to generate the structure you need to parse the form
Of course, you can implement methods to update the fields once the definition is generated but i never have found a situation that required it.