After the discussion about model features and its impact on getStructure size I propose we add filter logic to JSONWriter object so we can request only for some fields in the resulting JSON. This is a possible implementation (not fully optimized) that would produce the following output for filtered getStructure:
https://localhost:8080/json/apartment/getStructure?_dc=1484658491210&filter=apartment,zones,clusters,id,name
{"result":{"apartment":{"clusters":[{"id":16,"name":"Ventilation"},{"id":17,"name":"Shade2"},{"id":19,"name":"Cooling"},{"id":21,"name":"Audio"},{"id":22,"name":"Video 2"}],"zones":[{"id":0,"name":""},{"id":27304,"name":""},{"id":2,"name":""}]}},"ok":true}
So we could request the model features the same way, or just limit the current getStructure (I doubt that ui really uses all fields there). We could add child JSONFilteredWriter class that would have this logic so that non filtered request are without performance hit.
Please let me know what do you think about this.