3 ms·
I've found the openapi-generator client in Python to be pretty horrific to use; very un-idiomatic, hard to follow, and poorly documented. Any other projects th
by theptip 7y ago
I've found the openapi-generator client in Python to be pretty horrific to use; very un-idiomatic, hard to follow, and poorly documented.
Any other projects that are better? Or just projects that can do the "POPO <> JSON" mapping, ideally with type hints so that I can get code completion in my IDE? I'd be fine to manually wire up the HTTP parts for the SDKs that I write if I had a good schema mapper.
- odiroot 7y agoAt my current company, we decided to write our own library to consume Open API Spec (3.0+) and expose all the endpoints as marshmallow-validated functions. No code generation at all. The library just dynamically exposes proper structure depending on the spec.
- wing328hk 7y agoDo you mind opening an issue via http://github.com/OpenAPITools/openapi-generator/issues/new http://github.com/OpenAPITools/openapi-generator/issues/new with the details? (I assumed you've checked out the auto-generated documentation and that doesn't look good to you.) There were discussions on type hints but unfortunately no one has found the time to make the contribution yet. We also have a new `python-experimental` client generator that has better support for new features in OAS v3. Please check it out to see if it works better for you.
- theptip 7y agoThanks! I'll give the new generator a spin and see what it looks like. IIRC the problems I faced were around things like bearer token auth with JWT being confusing to configure, the general structure of the client being unintuitive for me, and a general lack of examples on how the client was supposed to be used. No problems that I couldn't resolve each in an afternoon, but way harder to work with than a hand-rolled SDK (even considering complex and arguably a bit confusing ones like https://developer.paypal.com/docs/api/quickstart/ https://developer.paypal.com/docs/api/quickstart/).