Skip to content

Put common models into a separate package #194

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

Closed
emann opened this issue Sep 21, 2020 · 1 comment
Closed

Put common models into a separate package #194

emann opened this issue Sep 21, 2020 · 1 comment
Labels
✨ enhancement New feature or improvement

Comments

@emann
Copy link
Collaborator

emann commented Sep 21, 2020

Is your feature request related to a problem? Please describe.
When using multiple generated clients in the same project, things like Client, HTTPValidationError, etc. can be imported from either client package even though they are the same.

Describe the solution you'd like

  1. Make a separate package called "openapi-python-client-models" or something similar that includes any models/functionality/etc. that is shared by all generated clients

  2. Add an option when generating to omit these common models (by default they should be included) and instead add openapi-python-client-models (or whatever the package is called) as a requirement for the client package

Describe alternatives you've considered
Instead of being configurable, the common stuff could just only live in a separate package that is added as a requirement, but I figure most people likely want everything together in one place.

@emann emann added the ✨ enhancement New feature or improvement label Sep 21, 2020
@dbanty
Copy link
Collaborator

dbanty commented Sep 21, 2020

I think this will be best covered by part of #171 once broken up. Specifically, supporting generating a single client from multiple documents.

While the clients are all identical today, they won't always be. Some day when we support multiple security mechanisms we'll need generated clients to be dynamic.

@dbanty dbanty closed this as completed Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants