hugues31 / coinnect

Coinnect is a Rust library aiming to provide a complete access to main crypto currencies exchanges via REST API.
MIT License
148 stars 43 forks source link

OpenAPI & codegen #47

Closed crackcomm closed 2 years ago

crackcomm commented 6 years ago

@hugues31 What do you think about creating OpenAPI specifications for exchanges and generating client code?

hugues31 commented 6 years ago

Didn't know OpenAPI since now, sounds very interesting but is a huge rework of the lib :/ so if anyone is interested in following this path, I encourage them, but I personally don't have the time to invest in this potential improvement

crackcomm commented 6 years ago

There seems to already exist a swagger-codegen template for rust.

tbourvon commented 6 years ago

This looks to me like it should be the top priority issue. Coinnect deals with (crypto)currencies, and as such reliability, stability and easiness of maintenance are very important. I'm probably going to start investigating this and maybe work on this first (before working on adding exchanges or futures).

tbourvon commented 6 years ago

As you can probably see, I've pushed a PR with a first sketch of a GDAX OpenAPI specification, along with the instructions to generate the Rust API from it. Please don't hesitate to comment on how you feel about this.

crackcomm commented 6 years ago

I certainly love that :) thank you

crackcomm commented 6 years ago

I would suggest keeping those auto-generated clients in a crate, on this type safe clients we can then implement more general traits, general for all exchanges.

I think we would need to split the traits as much as possible, eq. Ticker trait etc.

crackcomm commented 6 years ago

I can recommend using editor.swagger.io for editing the spec, it catches all errors.