CLI for scanning Spring Boot Kotlin APIs and generating OpenAPI + UI output
npm install spring-api-scannerScan a Spring Boot Kotlin service and generate:
- openapi.json (OpenAPI 3.0)
- A static API catalog UI (index.html + ui-data.json)
- Structured warnings (scan-warnings.json)
No code/dependency changes are required in the target Spring service.
``bash`
npm install
npm run build
Serve generated docs:
`bash`
node dist/index.js /path/to/spring-service --serve --port 3000
Export static docs only:
`bash`
node dist/index.js /path/to/spring-service --no-serve --output ./api-docs
`bash`
spring-api-scanner --help
`text
Usage: spring-api-scanner
Scan a Spring Boot Kotlin project and generate OpenAPI documentation and a static UI.
Options:
--serve Start a local server to serve the generated docs
--no-serve Only generate static files (default)
--port
--output
--title
--version
--strict Exit with non-zero code on unresolved critical issues
--help Show this help message
`
- @RestController@RequestMapping
- Class-level @GetMapping
- Method mappings:
- , @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping@RequestMapping(method = ...)
- @PathVariable
- Parameters:
- , @RequestParam, @RequestHeader, @RequestBodydata class
- Return type and DTO schemas from Kotlin enum class
- Enum schemas from Kotlin @NotNull
- Validation hints from common annotations (, @Size)
The generated UI includes:
- Search with keyboard shortcut (/) - Press / to focus the search box
- Deep-linking - Copy and share direct links to endpoints
- Filter persistence - Filter selections are saved to localStorage
- Collapsible schemas - Expand/collapse request/response body schemas
- Copy curl - One-click copy for curl commands
- Download - Export OpenAPI JSON
Schema field names follow these rules:
- Default DTO naming: snake_case@JsonNaming(PropertyNamingStrategies.LowerCamelCaseStrategy::class)
- If class has , fields stay camelCase
`bash`
npm test
npm run build
Integration + golden-file tests are under tests/integration.test.ts and tests/golden/openapi.sample-service.json.
See docs/ROADMAP.md for phased priorities (v0.2, v0.3, v1.0`).