Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement →
Sign In

@hey-api/spec-types

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hey-api/spec-types

📃 TypeScript definitions for OpenAPI and JSON Schema specifications with complete inline documentation.

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
528K
-12.66%
Maintainers
1
Weekly downloads
 
Created
Source
Hey API presents openapi-ts

Spec Types

TypeScript definitions for OpenAPI and JSON Schema specifications with complete inline documentation.

DevTrends badge for @hey-api/spec-types DevTrends badge for @hey-api/spec-types CI status GitHub stars MIT License

Manual  •  Issues  •  Contribute

About

TypeScript definitions for OpenAPI and JSON Schema specifications with complete inline documentation.

Part of the Hey API ecosystem.

Features

  • OpenAPI 2.0 (Swagger), 3.0, and 3.1 specifications
  • JSON Schema Draft 4 and Draft 2020-12
  • inline JSDoc on every property
  • zero runtime footprint, types only

Contributing

Want to see your code in products used by millions?

Start with our Contributing guide and release your first feature.

Sponsors

Hey API is sponsor-funded. If you rely on Hey API in production, consider becoming a sponsor to accelerate the roadmap.

Gold

Stainless logo
Best-in-class developer interfaces for your API.
stainless.com

Opencode logo
The open source coding agent.
opencode.ai

Silver

Scalar logo
scalar.com
FastAPI logo
fastapi.tiangolo.com

Bronze

Kinde logo Cella logo

Installation

You can download @hey-api/spec-types from npm using your favorite package manager.

npm

npm add @hey-api/spec-types -D -E

pnpm

pnpm add @hey-api/spec-types -D -E

yarn

yarn add @hey-api/spec-types -D -E

bun

bun add @hey-api/spec-types -D -E

Usage

OpenAPI

Hover over any property to see its definition from the specification.

import type { OpenAPIV3_1 } from '@hey-api/spec-types';

const doc = {
  openapi: '3.1.2',
  info: {
    title: 'My OpenAPI document',
    version: '1.0.0',
  },
} satisfies OpenAPIV3_1.Document;

JSON Schema

Full type coverage for Draft 4 and Draft 2020-12 schemas.

import type { JSONSchemaDraft2020_12 } from '@hey-api/spec-types';

const doc = {
  properties: {
    foo: {
      type: 'string',
    },
  },
  type: 'object',
} satisfies JSONSchemaDraft2020_12.Document;

License

Released under the MIT License.

Keywords

api-types

FAQs

Package last updated on 13 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts