Hi Olivier,
Here is a simple example of a string variable in the API, where it's converted to a boolean.
https://modelshare.mendix.com/models/f4a55f47-a3bc-406a-b047-aba236bc22c1/res-t-format-mandatory
Another example where a date string is converted to an actual datetime attribute:
https://modelshare.mendix.com/models/9e6f04f5-312b-4e0e-9ed0-afe894932390/rest-format-end-date
Let me know if you have any other questions!
Depending on how often the rest service is called, it shouldn't be too big of an issue. Once you are done with a non-persistent entity the garbage collection will remove it from memory.
If you want to improve your performance you can set the import mapping method to call a microflow instead of creating an object. That way you can import the json to your second data structure.
Here is some documentation that talks about it
https://docs.mendix.com/refguide/import-mappings
Edit: If you double click the grey entity in your mapping, it will open up the properties and this is where you can define this method.