DRAFT export openapi spec generated with utoipa #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Export an openapi spec for the VTN server with the utoipa crate.
This is a draft commit that explores usage of the utoipa crate.
The utoipa crate is popular and well-maintained. It provides macros, traits, and types for maintaining openapi documentation.
This draft generates documentation for two operations
The document was exported to generated-openapi.yaml with
Some callouts
Overall, the utoipa crate seems like a popular and safe choice. It requires a lot of macro boilerplate and there are some details to be aware relating to serde, but it's very easy to use and gets you 90% of the way there. And if the macros aren't working, you can always drop down into traits.
See https://docs.rs/utoipa/latest/utoipa/
and https://crates.io/crates/utoipa
and https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0