[REQ] Pair of server and storage codegens
Created by: ybelenko
Is your feature request related to a problem? Please describe.
I would like to generate both server stubs and MySQL schema for my project, but it's complicated to connect them right now. For instance, php-slim4
codegen doesn't know database table/field names whilemysql-schema
generator cannot access model property names. With current implementation it's very hard to use ORM(Object-Relational Mapping) engines with Active Record patterns.
Describe the solution you'd like
I was the first person who said that standalone MySQL generator without server framework makes no sense. However @wing328 convinced me to create it anyway and I did. As a result, we have server and storage codegens which cannot communicate with each other. I'm not saying mysql-schema
is completely useless right now, but it close to it.
-
The first thing that comes to mind is to create new mixed generator like
php-slim4-mysql-schema
, but it feels like a bad move. -
Add option
storage=mysql
to currentphp-slim4
codegen sounds right, but I think it's very hard to implement, because then I need to merge all MySQL generator features completely into server codegen. Also it requires to wrap all MySQL codegen variables with new variable like{{#mysql-schema-codegen}}{{/mysql-schema-codegen}}
. Maybe I'm overreacting and it's not so difficult.
Describe alternatives you've considered
I'm submitting this with discussion
label because I would like to hear any suggestions from community.
cc @OpenAPITools/generator-core-team