Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create python-flask openapi generator template so that controllers aren't overwritten #6

Closed
thomasyu888 opened this issue Mar 3, 2021 · 2 comments
Assignees

Comments

@thomasyu888
Copy link
Member

Currently, there is quite a bit of work in having to undo the changes that the openapi-generator does, but if we created our own templates to import from a core module within the package that is unchanged, then it wouldn't be an issue.

Essentially this is the command I run to generate a service:

openapi-generator generate -i openapi.yaml -g python-flask -o server -t .codegen/server/

To get to this point, you will want to:

  1. Create your own templates
    openapi-generator author template -g python-flask -o .codegen/server
    
  2. Edit the templates in these two places:
  3. Create core module by copying everything in controllers in your packages into core. example
  4. Run the generation command above and get something like this: example. Notice how everything in controllers now just pulls from core.controllers.queue_controller?
@tschaffter
Copy link
Member

We should create a GH repository where can be develop these template and either publish our custom openapi-generator to npmjs and/or Docker Hub (see openapi-generator Dockerfile).

@tschaffter
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants