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

@openapi-spec/types

v0.1.0

Published

TypeScript types for the OpenAPI Specification, covering versions 3.0, 3.1, and 3.2 with complete inline documentation

Readme

@openapi-spec/types provides TypeScript types for the OpenAPI Specification, covering versions 3.0, 3.1, and 3.2. Every object and field is modelled after the specification, and every field carries the specification's own description as JSDoc with a link to its section, so the spec is readable from your editor. The package ships types only, no runtime code.

Each version module targets the latest patch release of its minor line:

| Module | Specification | Notes | | -------------------------- | ---------------------------------------------------------- | ------------------------------------------------ | | @openapi-spec/types/v3.0 | OpenAPI 3.0.4 | | | @openapi-spec/types/v3.1 | OpenAPI 3.1.2 | Reuses 3.0 types for objects that did not change | | @openapi-spec/types/v3.2 | OpenAPI 3.2.0 | Reuses 3.1 types for objects that did not change |

Usage

// Every version as a namespace
import type { OpenAPIV3_0, OpenAPIV3_1, OpenAPIV3_2 } from '@openapi-spec/types'

// Or one version directly
import type { OpenAPIObject, SchemaObject } from '@openapi-spec/types/v3.1'

const doc: OpenAPIObject = {
  openapi: '3.1.2',
  info: { title: 'Pet Store', version: '1.0.0' },
  paths: {},
}

// SchemaObject takes an optional data type for its data-carrying fields:
// `enum`, `default`, `example`, and from 3.1 on `const` and `examples`
const status = {
  type: 'string',
  enum: ['available', 'pending', 'sold'],
  default: 'available',
} satisfies SchemaObject<string>

Conventions

  • Type names follow the specification's section names: InfoObject, PathItemObject, SchemaObject, and so on.
  • Fields the specification marks as deprecated carry an @deprecated tag.
  • Rules the type system can express are enforced: allowed fields, value shapes, and version-specific literals such as style values. Rules it cannot express, like mutually exclusive fields or "at least one of", are stated in the JSDoc instead.

The types are checked against the official example documents and the specification's own schema test corpus. See tests/README.md.

Sponsors

Like what we build over at middleapi? You can help keep it going through GitHub Sponsors or Open Collective. Every bit helps! 🚀

Organization Sponsors

Sponsors

Backers

With thanks to 36 past sponsors who helped get openapi-spec here.

License

Distributed under the MIT License. See LICENSE for more information.