When using the generator, you have full control to override all the templates used to generate the code. I use it to create PSR-7 messages and accept any PSR-18 client, and it works great.

When you first posted here, you could only define overrides for the templates that the generator already defines for tour destination language. Since version 5.1.0 (or thereabouts) you now have the ability to add your own templates and define the destination structure that they go into. That is immensely powerful.

The way it works is that the generator reads the OpenAPI description and creates a massive data structure with cuts through the components and operations in many ways. The templates use mustache, with virtually no logic in them (just looks over data, and conditions on whether data is there or not). The data structure is digest enough to allow you to do a lot when generating. But you have to think like moustache templates – any logic you want to include, needs to be generated in code so that it can run at runtime, not while you generate the code.