parseable
parseable copied to clipboard
Enhancement: Add swagger API documentation
Description
Adds API documentation using utoipa from within Rust code. Also generates an up-to-date openapi yaml spec as soon as the server starts up.
To view the swagger page, go to {endpoint}/swagger-ui/
To build the docusaurus page follow these steps-
rm -rf build/ # Remove the old build directory (might be unnecessary)
yarn docusaurus clean-api-docs all # remove pre-existing `mdx` files
yarn docusaurus gen-api-docs all # make new `mdx` files
yarn docusaurus build # build the server (or use whatever command you use to build production server)
npm run serve # Serve (or use production command)
Covered scopes-
logstreamqueryingestionuserrbacliveness(partial since can't add two variants of the same endpoint)readiness(partial since can't add two variants of the same endpoint)
Quirks
Request headers are specified as an attribute for params of a request and hence can't be optional (added a note in their description explaining their nature)
This PR has:
- [x] been tested to ensure log ingestion and log query works.
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [x] added documentation for new or modified features or behaviors.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA