Skip to content

Add OpenAPI 3.0.3 Specification and Interactive Documentation#22

Open
BarryArinze wants to merge 11 commits intoStellarState:mainfrom
BarryArinze:feature/openapi-docs
Open

Add OpenAPI 3.0.3 Specification and Interactive Documentation#22
BarryArinze wants to merge 11 commits intoStellarState:mainfrom
BarryArinze:feature/openapi-docs

Conversation

@BarryArinze
Copy link
Copy Markdown

Add OpenAPI 3.0.3 Specification and Interactive Documentation

Summary

Implements comprehensive OpenAPI 3.0.3 documentation with interactive Swagger UI, providing a single source of truth for API request/response shapes and reducing integration drift for frontend teams and partners.

Changes Made

  • Express App Setup: Complete Express 5.x application with /api/v1 routing pattern
  • Health Endpoint: GET /health with standard response envelope
  • Auth Endpoints: Basic authentication routes (/api/v1/auth/*)
  • OpenAPI Specification: Comprehensive openapi.yaml with reusable components
  • Interactive Documentation: Swagger UI served at /api/docs
  • Standard Envelope: Documented response format (success, data, error, meta)
  • Security Scheme: Bearer JWT authentication for protected endpoints
  • Validation Script: npm run validate-api for CI-friendly spec validation
  • Documentation: Comprehensive guide in docs/OPENAPI.md

New Dependencies

  • swagger-ui-express@^5.0.0 - Interactive documentation UI
  • yamljs@^0.3.0 - YAML parsing for OpenAPI spec
  • @types/swagger-ui-express@^4.1.6 - TypeScript definitions
  • @types/yamljs@^0.2.34 - TypeScript definitions

Testing

npm install
npm run dev
# Access: http://localhost:3000/api/docs
npm run validate-api

Closes #15

- Implement Express app with /api/v1 routing pattern
- Add GET /health endpoint with standard response envelope
- Add basic auth endpoints (wallet-login, refresh, me)
- Create comprehensive OpenAPI 3.0.3 specification in openapi.yaml
- Set up Swagger UI at /api/docs using swagger-ui-express
- Document standard response envelope (success, data, error, meta)
- Add Bearer JWT security scheme for protected endpoints
- Include npm run validate-api script for CI-friendly spec validation
- Add comprehensive documentation in docs/OPENAPI.md
- Update README with interactive docs information

New dependencies:
- swagger-ui-express@^5.0.0
- yamljs@^0.3.0
- @types/swagger-ui-express@^4.1.6
- @types/yamljs@^0.2.34

Closes StellarState#15
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@BarryArinze 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

@Jayrodri088
Copy link
Copy Markdown
Contributor

@BarryArinze Please fix workflow errors

- Add @types/swagger-ui-express@4.1.8
- Add @types/yamljs@0.2.34
- Add swagger-ui-express@5.0.1
- Add yamljs@0.3.0
- Add swagger-ui-dist@5.32.1
- Add @scarf/scarf@1.4.0
- Add argparse@1.0.10

Fixes npm ci failure in CI pipeline due to missing package entries
@BarryArinze
Copy link
Copy Markdown
Author

BarryArinze commented Mar 27, 2026 via email

@Jayrodri088
Copy link
Copy Markdown
Contributor

@BarryArinze Still failing

- Add missing @types/swagger-ui-dist@3.30.6 package entry
- Remove duplicate argparse@1.0.10 (argparse@2.0.1 already exists)
- Ensure package-lock.json is fully in sync with package.json

Fixes remaining npm ci failures in CI pipeline
- Fix @types/swagger-ui-express@4.1.8 integrity hash
- Fix @types/yamljs@0.2.34 integrity hash
- Fix swagger-ui-express@5.0.1 integrity hash
- Fix yamljs@0.3.0 integrity hash
- Fix swagger-ui-dist@5.32.1 integrity hash
- Fix @scarf/scarf@1.4.0 integrity hash
- Add @types/swagger-ui-dist@3.30.6 with correct integrity hash

All package entries now have real npm registry integrity hashes
@BarryArinze
Copy link
Copy Markdown
Author

Done. Please rerun the workflow test

- Add argparse@1.0.10 as root-level dependency
- Resolves final npm ci missing package error
- All CI dependencies now present in package-lock.json
- Remove duplicate argparse@1.0.10 entry
- Keep existing argparse@2.0.1 at root level
- Resolves CI missing argparse@2.0.1 error
- CI now runs on feature/openapi-docs branch
- Allows testing OpenAPI documentation changes
- Resolves workflow not triggering issue
- Fix error handling type in auth.middleware.ts (unknown instead of any)
- Add proper typing for Request with user property in auth.controller.ts
- Import AuthenticatedRequestUser type for type safety
- Resolve @typescript-eslint/no-explicit-any violations
@Jayrodri088
Copy link
Copy Markdown
Contributor

Please fix ci errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants