ibind icon indicating copy to clipboard operation
ibind copied to clipboard

[RFC]: using openapi generators for typesafety?

Open rayli09 opened this issue 6 months ago • 1 comments

Hi! loved the project, a really good enhancement would be type safety. I've seen a few others mentioned this in #105 for example, but wouldn't a simpliest way is to use openapi generators from 1.0's spec?

i tested and it's working fine -- hence would like to bring this up for discussion.

to even get more fine-grained control + better quality, one can also use stainlessapi

rayli09 avatar Jun 08 '25 20:06 rayli09

Hey @rayli09 thanks for the kind words and for bringing up the OpenAPI.

The short answer is: before building IBind I tried using the spec for OpenAPI and it lead nowhere.

The generated code was cluttered - with a ton of code that was unnecessary for IBKR Web API -, overly complex, hard to debug and the tests would fail from the get go. I gave it a couple of hours and decided not to invest more time into it. In hindsight I think that was the correct decision, as I believe it's better to start small and scale up, than start way too large and spend time cutting content out.

I'm glad to see that you had more luck! Although scanning through the repo you've posted I see the same level of clutter - I think that maintaining it wouldn't be trivial. In either case using it now would completely override pretty much everything - how would you see using OpenAPI as an enhancement to this library?

Voyz avatar Jun 13 '25 16:06 Voyz