Add automatic creation of open api documentation through the aide crate #1672
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.
These changes allow for open api documentation to be generated automatically when people run the app.
I wrote these changes awhile ago hence being several versions behind and I don't fully remember how the changes work but I've been meaning to get around to making a PR for a while now.
I'm aware https://github.com/loco-rs/loco-openapi-Initializer has come about since I made this fork but that makes use of Utoipa which I have always found fiddly to use. It requires that paths and params be repeated twice, once in the documentation and once in the code, which defeats the entire point of auto generating documentation.
This PR instead uses the code as a single source of truth meaning that changes in the code are reflected in the documentation in real time.
I've furthermore been able to make use of this by using the generated docs to create a full api client in my frontend code using the openapi-qraft generator which may be worth integrating in a future PR.
I'm pretty certain this PR involves several breaking changes however as I said, it's been almost a year since I made the fork and I haven't worked on it since so I don't remember and won't have the time to check it properly for a couple of weeks.