npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

spring-api-scanner

v0.2.6

Published

CLI for scanning Spring Boot Java/Kotlin APIs and generating OpenAPI + UI output

Readme

spring-api-scanner

Scan a Spring Boot Java/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.

Quickstart

npm install
npm run build

Serve generated docs:

node dist/index.js /path/to/spring-service --serve --port 3000

Export static docs only:

node dist/index.js /path/to/spring-service --no-serve --output ./api-docs

Scan directly from Bitbucket repo + branch:

node dist/index.js --repo https://bitbucket.org/acme/orders-service.git --branch develop --no-serve --output ./api-docs

CLI

spring-api-scanner --help
Usage: spring-api-scanner <projectPath> [options]
       spring-api-scanner --repo <git-url> [options]

Scan a Spring Boot Java/Kotlin project and generate OpenAPI documentation and a static UI.

Options:
  --repo <url>         Clone and scan from a remote git repository (supports Bitbucket)
  --branch <name>      Branch to clone with --repo (default: main)
  --keep-clone         Keep cloned repo directory after scan (default: cleanup)
  --serve              Start a local server to serve the generated docs
  --no-serve           Only generate static files (default)
  --port <number>      Port for the server (default: 3000)
  --output <path>      Output directory for generated files (default: ./api-docs)
  --title <string>     API title for documentation (default: "Spring API Docs")
  --version <string>   API version for documentation (default: 1.0.0)
  --strict             Exit with non-zero code on unresolved critical issues
  --help               Show this help message

What It Extracts

  • @RestController
  • Class-level @RequestMapping
  • Method mappings:
    • @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping
    • @RequestMapping(method = ...)
  • Parameters:
    • @PathVariable, @RequestParam, @RequestHeader, @RequestBody
  • Return type schemas (including reactive wrappers like Mono<T>/Flux<T>)
  • DTO schemas from Kotlin data class, Java class, and Java record
  • Enum schemas from Kotlin enum class and Java enum
  • Validation hints from common annotations (@NotNull, @Size)

UI Features

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
  • Schema naming toggle - Switch schema and example keys between snake_case and camelCase
  • Example payloads - Request/response example JSON generated from resolved schema
  • Copy curl - One-click copy for curl commands
  • Download - Export OpenAPI JSON

Naming Strategy Notes

Schema field names follow these rules:

  • Kotlin DTO default naming: snake_case
  • Java DTO default naming: camelCase
  • If class has @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy::class), fields become snake_case
  • If class has @JsonNaming(PropertyNamingStrategies.LowerCamelCaseStrategy::class), fields stay camelCase

The UI naming toggle only changes how schema/example keys and curl body keys are displayed. It does not rewrite the generated openapi.json source of truth.

Type Coverage Notes

Common Java/Kotlin/JVM types are mapped, including:

  • Scalars: String, Char, char, Int, int, Integer, Long, long, Short, short, Byte, byte, unsigned numeric variants, Boolean, boolean, Float, float, Double, double, BigDecimal, BigInteger
  • Date/time: Instant, LocalDate, LocalDateTime, OffsetDateTime, ZonedDateTime
  • Other common types: UUID, ByteArray, Any
  • Collections/wrappers: List, Set, Collection, Page, Array, primitive arrays, Java arrays (T[]), Map, ResponseEntity<T>, Mono<T>, Flux<T>, Publisher<T>, Optional<T>
  • Generic DTO classes with concrete arguments (for Kotlin data class, Java class, and Java record), e.g. ApiResponse<UserDto>

Generic DTO component names are materialized with type arguments (example: ApiResponseOfUserDto) to keep schema resolution deterministic.

Development

npm test
npm run build

Integration + golden-file tests are under tests/integration.test.ts and tests/golden/openapi.sample-service.json.

Roadmap

See docs/ROADMAP.md for phased priorities (v0.2, v0.3, v1.0).