Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] Properties with type 'any' in DTOs

Hi
Can you provide some examples of DTO and their usage?
I want to understand your use case more clearly.

Sergii Kabashniuk


On Sun, Jun 14, 2015 at 3:01 PM, Sharafy, Tareq <tareq.sharafy@xxxxxxx> wrote:

Hi,

We are still suggesting improvements to the DTO generator that will improve support for externally defined JSONs. One very common characteristic of several services is defining some properties with type 'any', allowing parts of the data to be transferred as freely structured JSONs. Right now Che's DTO solution doesn't support this feature (Map properties are not sufficient here).

My proposal is to support DTO properties with type JsonElement. The generated deserializer and copy constructor will copy the matching part of the input JSON, and the matching serializer will copy the property's value to the output JSON. The currently generated functions toJson() and fromJsonString(str) create temporary JSONs so I added an internal parameter that prevents redundantly copying JSONs for 'any' properties in these flows.

Please review my pull request for the above proposal or alternatively provide any insights for suggestions:
www.github.com/codenvy/che-core/pull/116

thank you
Tareq Sharafy
Cloud Development Experience | SAP Labs Israel | 15 Hatidhar st, Raanana 43665, Israel
T +972-(0)7-4732-1647 | F +972-(0)9-777-5618


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



Back to the top