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

generator-jhipster-swagger-api-first

v1.0.1

Published

JHipster module to support API first development using swagger

Downloads

345

Readme

generator-jhipster-swagger-api-first

NPM version Build Status Dependency Status

JHipster module, JHipster module to support API first development using swagger

Introduction

This module uses the swagger-codegen-maven-plugin to bring API-first development to your JHipster application. In API first development, instead of generating the doc from the code, you first write the spec and generate the code from it. This has the following advantages:

  • you design your API for the consumers and not as a consequence of your implementation.
  • you can use it to mock your new server endpoints before they are released so you decouple more between frontend and backend dev
  • you don't need a live server to use your swagger spec

Note : the module currently only works with Maven.

Prerequisites

As this is a JHipster module, we expect you have JHipster and its related tools already installed:

Installation

To install this module:

yarn global add generator-jhipster-swagger-api-first

Usage

At the root of your project

yo jhipster-swagger-api-first

This will configure the swagger-codegen-maven-plugin in your pom.xml so that, when you compile, the spec located at src/main/resources/swagger/api.yml is used to generate endpoint interfaces that you can implement. Those interfaces have default methods which answer with a 200 HTTP status and an empty body.

Write your spec using a tool such as swagger-editor, put it in src/main/resources/swagger/api.yml, then :

./mvnw generate-sources

Then implement the interfaces generated in target/generated-sources/swagger/src/main/java/${package}/web/api/controller with @RestController classes.

Example of code to write yourself for the famous petstore spec:

@RestController
@RequestMapping("/api/petstore")
public class PetStore implements PetApi, StoreApi, UserApi {

    @Override
    public ResponseEntity<List<Pet>> findPetsByStatus(@RequestParam List<String> status) {
        return new ResponseEntity<>(
            status.stream()
                .distinct()
                .map(Pet.StatusEnum::fromValue)
                .map(statusEnum -> new Pet().id(RandomUtils.nextLong()).status(statusEnum))
                .collect(Collectors.toList()),
            HttpStatus.OK);
    }
}

License

Apache-2.0 © Christophe Bornet