Does fermyon or spin capable have macro on generating api documentation? #2537
Replies: 2 comments 2 replies
-
That page is describing how to write a custom client for the Fermyon Cloud REST API, which I don't think is what you are actually after? But I am not sure if you are asking how to build your own REST API or how to generate documentation for a REST API. |
Beta Was this translation helpful? Give feedback.
-
Gotcha, you're looking to implement something like https://docs.rs/utoipa/latest/utoipa/ in a Spin app, right? It looks like the macro there should work - it doesn't seem to rely on any specific framework. You can then use the Router (see e.g. https://github.com/fermyon/spin-rust-sdk/blob/184946fdd3cb48de3c3af60f8e053b42947c791b/examples/http-router/src/lib.rs#L9) to map a sub-route to the OpenAPI JSON (adapting e.g. https://github.com/juhaku/utoipa/blob/d020f92a0446adc7e99999aa9e1be63e95728fbb/examples/todo-tide/src/main.rs#L50). Then if you want e.g. HTML docs there are various tools that can generate them off the OpenAPI spec. |
Beta Was this translation helpful? Give feedback.
-
There is a link
https://developer.fermyon.com/cloud/rest-api
telling to add this to cargo.toml
if we add this , what does it do?
Ive check that repo there isnt a topic telling how to specify a specific route using spin sdk
to generate an api documentation for that...
i believe on some packages e.g. actix they use some macro
I would like to know how to generate those Api documentation
Beta Was this translation helpful? Give feedback.
All reactions