Problem
There is no OpenAPI specification or Swagger UI for the
API. Developers integrating with StepFi must read source
code to understand endpoint shapes, request/response
schemas, and auth requirements.
What To Build
-
Install @nestjs/swagger and configure SwaggerModule in
main.ts with title "StepFi API", version from package.json,
description, and bearer auth scheme.
-
Add @apitags, @apioperation, @apiresponse decorators to
every endpoint across all modules:
- Auth (nonce, verify, refresh)
- Learners (profile CRUD)
- Loans (create, list, approve, assess, repay, check-default)
- Sponsors (portfolio, yield, funded-loans)
- Vendors (register, approve, dashboard stats, API keys)
- Admin (parameters, audit logs, protocol stats)
- Vouching (request, list, approve, revoke)
- Pool (stats, deposit/withdraw XDR)
- Health (indexer status, Stellar endpoint health)
- Indexer (status, replay)
-
Use @ApiBody, @ApiParam, @apiquery for input schemas.
Use @ApiBearerAuth() on all protected endpoints.
Use @ApiOkResponse, @ApiCreatedResponse, @ApiErrorResponse.
-
Generate typed DTO classes with class-validator decorators
and expose them via @ApiProperty.
-
Add GET /docs and GET /docs-json routes:
- /docs renders Swagger UI
- /docs-json returns raw OpenAPI spec
-
In development: enable Swagger UI.
In production: serve under /docs with basic auth guard
using DOCS_USERNAME and DOCS_PASSWORD env vars, or
disable entirely via SWAGGER_ENABLED=false.
Files To Touch
- src/main.ts
- All controller files (add decorators)
- All DTO files (add @ApiProperty)
- src/common/decorators/api-paginated.decorator.ts (new)
- src/common/dto/paginated-response.dto.ts (new)
Acceptance Criteria
Mandatory Checks Before PR
Problem
There is no OpenAPI specification or Swagger UI for the
API. Developers integrating with StepFi must read source
code to understand endpoint shapes, request/response
schemas, and auth requirements.
What To Build
Install @nestjs/swagger and configure SwaggerModule in
main.ts with title "StepFi API", version from package.json,
description, and bearer auth scheme.
Add @apitags, @apioperation, @apiresponse decorators to
every endpoint across all modules:
Use @ApiBody, @ApiParam, @apiquery for input schemas.
Use @ApiBearerAuth() on all protected endpoints.
Use @ApiOkResponse, @ApiCreatedResponse, @ApiErrorResponse.
Generate typed DTO classes with class-validator decorators
and expose them via @ApiProperty.
Add GET /docs and GET /docs-json routes:
In development: enable Swagger UI.
In production: serve under /docs with basic auth guard
using DOCS_USERNAME and DOCS_PASSWORD env vars, or
disable entirely via SWAGGER_ENABLED=false.
Files To Touch
Acceptance Criteria
Mandatory Checks Before PR