rust-lang-ve / hilow

"Hilow" is a microblogging social feed where users are able to share they thoughts on different topics
Other
3 stars 4 forks source link

API documentation with swagger #9

Open rafacouto opened 3 years ago

rafacouto commented 3 years ago

An OpenAPI definition should be generated by the app itself.

Sections to generate:

EstebanBorai commented 3 years ago

Sounds awesome!

The best approach for this feature is to have Swagger docs generated automatically, so we don't rely on manual work to update the swagger docs as we move forward with this.

Searching the web for a crate to achieve this I've found this crate:

https://crates.io/crates/cargo-swagg

I think we could start this way perhaps?

If you have any other suggestions please share them here so we have more options to accomplish this

rafacouto commented 3 years ago

I've tested codegen from swagger to rust and it generates the stub of structs and the skeleton. But I see cargo-swagg more convenient to generate the actix skeleton. BTW, #10 contains a draft with 4 endpoints based on the API definition on README.md to test these or other proposed tools.