Closed kindaro closed 3 years ago
@kindaro thanks for this. The intention of this particular generator is to create a server that just returns example content, rather than as a basis for a node server.
I have actually worked on a node server with this in mind... it's separate from this repository, as probably a number of these generators should end up being! Check out https://github.com/karlvr/openapi-generator-plus-express-passport and see if this is going in the right direction for you. I haven't updated it in a little while, but we are currently using it in production in its current form.
Thanks!
Currently, the work flows like this:
This has the disadvantage that the generated code has to be edited (request handlers written inline) and therefore committed. However, as a rule, generated code should not be committed. Committing a patch over the generated code also has obvious drawbacks, such as being fragile and unwieldy.
The solution is to parametrize the generated code by the request handlers. This can be done in two ways: