Skip to content

Improve documentation with search, API URLs, OpenAPI spec, and contract validation - #144

Merged
valoryyaa-byte merged 5 commits into
RWA-ToolKit:mainfrom
chukwudiikeh:feat/docs-improvements
Jul 28, 2026
Merged

Improve documentation with search, API URLs, OpenAPI spec, and contract validation#144
valoryyaa-byte merged 5 commits into
RWA-ToolKit:mainfrom
chukwudiikeh:feat/docs-improvements

Conversation

@chukwudiikeh

Copy link
Copy Markdown
Contributor

Summary

This PR addresses all four documentation issues identified in the backlog:

Changes

Commit 1: Fix hardcoded localhost URLs (#53)

  • Add API_BASE_URL export to site config
  • Update all 15 API endpoint examples to use $API_BASE_URL placeholder
  • Document configuration clearly in API Overview

Commit 2: Add client-side search (#54)

  • Implement FlexSearch-based documentation search
  • Keyword and title-based indexing of all doc pages
  • Dropdown results with section grouping and excerpts
  • Keyboard shortcut (⌘K) to focus search input

Commit 3: Add OpenAPI 3.0 specification (#55)

  • Comprehensive REST API schema covering all endpoints
  • Proper request/response schemas with i128 string handling
  • HTTP status codes and error responses documented
  • Available at /openapi.json for Swagger UI and SDK generation

Commit 4: Add contract validation tests (#56)

  • Contract specifications in lib/contracts.ts with method signatures, auth, errors
  • Jest test suite validating all documented methods match specs
  • Contract address and parameter count validation
  • CI-ready with npm test support
  • Documentation in CONTRACT_VALIDATION.md

Testing

All tests are configured and ready to run with npm test. The contract validation ensures:

  • ✅ All documented methods exist in the spec
  • ✅ All spec methods are documented
  • ✅ Method signatures match
  • ✅ Critical methods are present

Closes #54 , Closes #53 , Closes #55 , Closes #56

@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@chukwudiikeh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…E_URL

Replace http://localhost:8080 throughout API documentation with environment-configurable NEXT_PUBLIC_API_BASE_URL, defaulting to localhost for development. Add API_BASE_URL export to site config and update all API endpoint examples to use $API_BASE_URL placeholder with clear notes about configuration.

Closes RWA-ToolKit#53

Co-Authored-By: chukwudiikeh <chukwudi.ikeh.232330@unn.edu.ng>
Add FlexSearch-powered documentation search with:
- Keyword and title-based indexing of all doc pages
- Real-time filtering with results displayed in dropdown
- Keyboard shortcut (⌘K) to focus search input
- Results grouped by section with excerpts
- Integrated into sidebar for easy access

Closes RWA-ToolKit#54

Co-Authored-By: chukwudiikeh <chukwudi.ikeh.232330@unn.edu.ng>
Add comprehensive OpenAPI 3.0 schema for the REST API at /openapi.json with:
- All endpoints (stats, assets, holders, compliance, dividends)
- Complete request/response schemas with descriptions
- Proper HTTP status codes and error responses
- Data types matching i128 handling (strings for large integers)
- Server configurations for development and production URLs

Closes RWA-ToolKit#55

Co-Authored-By: chukwudiikeh <chukwudi.ikeh.232330@unn.edu.ng>
Add comprehensive contract validation system to ensure documentation stays in sync:
- Contract specifications in lib/contracts.ts with method signatures, auth, errors
- Jest test suite validating all documented methods match contract specs
- Validation checks for method parameter counts, contract addresses, auth requirements
- Jest configuration with test discovery and coverage setup
- Documentation of validation process in CONTRACT_VALIDATION.md
- Note in Asset Token contract page referencing the validation system

This enables CI/CD to catch documentation drift before deployment.

Closes RWA-ToolKit#56

Co-Authored-By: chukwudiikeh <chukwudi.ikeh.232330@unn.edu.ng>
@chukwudiikeh
chukwudiikeh force-pushed the feat/docs-improvements branch from 9584a8b to 14148ba Compare July 26, 2026 05:32
@valoryyaa-byte
valoryyaa-byte merged commit 9ba8ae0 into RWA-ToolKit:main Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants