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

[Design] Are you using a code generator ? What about pydantic and HTTPX ? #694

Closed
FabriceSalvaire opened this issue Nov 12, 2020 · 4 comments
Assignees

Comments

@FabriceSalvaire
Copy link

I guess commits like "Codegen for openapi ..." means you are using a code generator which is not is the source ???

Maybe you should consider for a refactoring of this library:

Also the code of object_classes.py could be replaced by a "registration" metaclass.

@remi-stripe remi-stripe self-assigned this Nov 12, 2020
@remi-stripe
Copy link
Contributor

@FabriceSalvaire Thanks for the feedback! We are automatically generating most of our client libraries (all but stripe-go) from our openapi spec today!

Adding type support is unfortunately not something we will do in the short term because of the way the library is built. Today it supports every API version which means that when you retrieve an API object the types depend on the API version associated with the API request and it makes some types conflict with each other (a property was a boolean and is now an enum for example). For a type system to work well, we'd need to have the stripe-python library pinned to a specific API Version which is something we're considering in the future!

Similarly, for async support, it requires dropping support for older Python versions which are still used a lot by our users. It would also require a re-design of the library which we would likely tie to core improvements such as the typing system you mentioned above!

I'm going to close this out since we already have other issues tracking those feature requests in #327 and #650 I hope it's okay!

@maxdeichmann
Copy link

@remi-stripe i just came across this and was wondering: how are you guys building python code from the openapi docs? Are you using the 'official' openai converter? (https://github.com/OpenAPITools/openapi-generator)

@remi-stripe
Copy link
Contributor

@maxdeichmann We built our own codegen tooling internally. It parses our openapi spec files and then generates all our server-side libraries today! Unfortunately none of it is open sourced at the moment sorry.

@maxdeichmann
Copy link

@maxdeichmann We built our own codegen tooling internally. It parses our openapi spec files and then generates all our server-side libraries today! Unfortunately none of it is open sourced at the moment sorry.

No worries, thanks for the info!

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

3 participants