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 🙏

© 2024 – Pkg Stats / Ryan Hefner

newman-reporter-openapi

v0.0.8

Published

Newman reporter for OpenAPI coverage

Downloads

336

Readme

newman-reporter-openapi

Newman reporter for openapi spec coverage


This is a Newman OpenAPI reporter for generating coverage reports from a Newman run based on an OpenAPI specification.

It was inspired by the openapi-backend projects route matching and a desire to see how much of the OpenAPI spec automated test generators were producing.

It determines coverage as how much of the path/method/response tree has requests made during the run.

├── path
|   └── method
|       ├── response
|       ├── response
|       └── response
└── path
    └── method
        ├── response
        └── response

It produces output like this: wide

Install the reporter


npm install newman-reporter-openapi
or
npm install -g newman-reporter-openapi

Reporter options


Add the report as a custom Newman reporter:

newman --reporters openapi

You can include multiple Newman reporters like this:

newman --reporters "cli,openapi"

The only required parameter for the OpenAPI reporter is the OpenAPI spec using --reporter-openapi-spec:

--reporter-openapi-spec ./openapi.yaml

The reporter will check each Newman API call against the server list in your OpenAPI spec.

If the server isn't in that list, for local testing for example, you can specify it via --reporter-openapi-serverUrl

--reporter-openapi-serverUrl http://127.0.0.1/3000

The reporter has three different report styles with different layouts. The default is wide.

--reporter-openapi-reportstyle wide
--reporter-openapi-reportstyle tall
--reporter-openapi-reportstyle summary

Coming soon --exportFilename for a json based export of the coverage.

Report symbols


In the reports the response codes have the following symbols:

  • + shows a response that was received
  • - shows a response that was not received
  • ? shows a received response that was not part of the spec

Report styles


There are three different versions of the report.

wide - best for when your spec has many different paths (the default) wide

tall - an option for APIs with a small number of paths otherwise it can get too tall tall

summary - for a basic summary of the coverage without path or response details summary