feat: add automatic Merkle API documentation generation #412
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.
Summary
Implements automatic documentation generation for the Merkle API using OpenAPI/Swagger specification.
Resolves #335
Changes
1. OpenAPI Specification
specs/merkle-api.yamlwith complete API documentation for:POST /api/create- Create Merkle airdrop campaignsGET /api/eligibility- Check recipient eligibilityGET /api/validity- Validate campaign IPFS CID2. Auto-Generation CLI Command
cli/commands/autogen/merkle.tsfor generating docs from spec3. Docusaurus Configuration
docusaurus-plugin-openapi-docsanddocusaurus-theme-openapi-docsdocItemComponent: "@theme/ApiItem"for proper SSG support4. Auto-Generated Documentation
Benefits
bun run cli/index.ts autogenTesting
Build tested successfully:
Related Issues
Future Work
The OpenAPI spec is currently maintained manually in this repo. For 100% automation, see merkle-api#47 which proposes adding
utoipato the Rust backend to auto-generate the spec from code.