I am trying to output a complete JSON edition of a page. Here I encounter the problem that fields like images, tags or structures are not automatically converted. These must be unpacked separately.
Is there a central method to convert the complete content into a JSON?
At the moment I only see the possibility to go through each field individually, find out what type of field it is and convert it individually. This requires all field types in the code to be hardwired.
I would be very happy about a tip, which leads me in a better direction.
No, because there is no 1:1 correlation, e.g. a files field can be used with toFile() for a single file, or toFiles() for multiple files etc. so it really depends on the desired output.
Maybe it would make more sense to create a JSON content representation for each page.