OpenAPITools / OpenAPITools/openapi-generator

[REQ] Pair of server and storage codegens

Open
#7,113 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature General: Discussion Schema: MySQL Server: PHP
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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.

  1. 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.

  2. Add option storage=mysql to current php-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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the php-slim4 and mysql-schema generators and how their model, table, and field information is currently handled. Review the generator integration points and discuss whether a combined generator or storage option is appropriate. Done would require an agreed design for sharing server and MySQL schema data, since the issue does not define an implementation or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
api, backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.