Hi Damiano,
Please check if your JSON is valid before trying to process it in Mendix. It seems not only the brackets [] are missing, but also the comma's between the objects. You can use an online validator, like jsonlint.com
For simplicity, I would say: skip the Root object:
You then got rid of the Root object, as you don't use it. The result of the Import Mapping will then be a list of 'fotografia'.
Keep in mind that this Import Mapping is directly creating new items in your database. For single-use or PoC projects, that's fine, for production environments I would recommend to import everything first non-persistent and perform validations on these non-persistent objects before processing and storing them.
Good luck!
Hi Johan,
thank you for the reply-
I've got rid of that root entity and now the rest CALL returns a list of "fotografia", thank you for that advice.
Now i tried changing my code to write this in a string:
I tried putting it on that website you mentiond before and here's the result:
apparently the date format is invalid (i tried checking the validation after deleting the date and in that case it's valid)
However:
I'm a bit confused on why it returns this, the objects are divided by the comma.
Thanks for the help.
Also, could you explain a bit more on the part you said about the import mapping creating a new object?
I didn't think that there would be other valid options, but if you can illuminate me about other approaches then tell me.
Thanks again.