This adds some types and extensions to Vapor's Route
type that allows documenting each route.
Also, a ViewContext
object helps in bringing these documentations to a web page.
Finally, there's a default docs page to show all collected route documentation.
Add the following dependency to your Package.swift
:
.package(url: "https://github.com/sersoft-gmbh/route-docs.git", from: "2.0.0"),
- For Vapor up to version 3, use RouteDocs version 1.x.y.
- For Vapor as of version 4, use RouteDocs version 2.x.y.
While not yet integrated, the following features might provide added value and could make it into RouteDocs in the future:
- Improved cycle detection
- Better representation of types that are named but encode as a single raw value (e.g.
RawRepresentable
types)
The API is documented using header doc. If you prefer to view the documentation as a webpage, there is an online version available for you.
If you find a bug / like to see a new feature in RouteDocs there are a few ways of helping out:
- If you can fix the bug / implement the feature yourself please do and open a PR.
- If you know how to code (which you probably do), please add a (failing) test and open a PR. We'll try to get your test green ASAP.
- If you can do neither, then open an issue. While this might be the easiest way, it will likely take the longest for the bug to be fixed / feature to be implemented.
See LICENSE file.