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

@unispechq/unispec-schema

v0.5.2

Published

Official UniSpec JSON Schemas

Readme

UniSpec Specification

Official specification of the UniSpec API definition language

Overview

UniSpec is a modern, multi-protocol API specification format designed to unify REST, GraphQL, WebSocket, and event-driven API documentation under a single, consistent model.

This repository is the single source of truth for the UniSpec format. It contains everything required to understand, validate, and evolve the language:

  • Machine-readable JSON Schemas
  • Human-readable reference documentation
  • Official examples (REST, GraphQL, WebSocket, mixed APIs)
  • A companion test specification (UniSpec Tests) for executable test documents

Repository Structure

unispec-spec/
├─ schema/            # JSON Schemas defining the UniSpec format
│  ├─ unispec.schema.json          # Core UniSpec document
│  ├─ unispec-tests.schema.json    # UniSpec Tests document
│  ├─ unispec-config.schema.json   # UniSpec Config document
│  └─ types/                       # Shared schema types
│     ├─ common.schema.json       # Common definitions
│     ├─ service.schema.json      # Service definition
│     ├─ rest.schema.json          # REST protocol
│     ├─ graphql.schema.json       # GraphQL protocol
│     ├─ websocket.schema.json     # WebSocket protocol
│     └─ schemas.schema.json       # Reusable schemas
│
├─ examples/          # Real-world examples in JSON format
│  ├─ valid/                         # Conforming examples
│  │  ├─ spec/                       # Valid UniSpec specifications
│  │  │  ├─ rest-simple.json         # Simple REST API
│  │  │  ├─ graphql-simple.json      # GraphQL API
│  │  │  ├─ websocket-simple.json    # WebSocket API
│  │  │  └─ mixed-complete.json      # Multi-protocol API
│  │  └─ config/                     # Valid configuration files
│  │     ├─ simple-multi-service.json
│  │     ├─ registry-based.json
│  │     ├─ complete-enterprise.json
│  │     └─ bearer-token.json
│  └─ invalid/                       # Schema violations for testing
│     ├─ spec/                       # Invalid specifications
│     └─ config/                     # Invalid configurations
│
├─ docs/              # Detailed format documentation
│  ├─ unispec.md                     # UniSpec document format
│  ├─ unispec-tests.md               # UniSpec Tests format
│  └─ unispec-config.md              # UniSpec Config format
│
├─ reference/         # Human-readable reference docs
│  ├─ fields.md                     # Complete field reference
│  ├─ versioning.md                 # Versioning guidelines
│  └─ style-guide.md                # Documentation style guide
└─ CHANGELOG.md       # Release notes

Purpose of This Repository

This repo defines the UniSpec language, not its implementation.

This repository contains:

  • Format specification
  • JSON Schemas
  • Examples and documentation
  • Rules for versioning and compatibility
  • Documented process for evolving the format over time

This repository does NOT contain:

  • UniSpec Core engine
  • CLI implementation
  • Framework adapters
  • Portal or Registry code
  • Runtime logic

These live in other repositories of the UniSpec organization.

Format Philosophy

UniSpec is built on the following principles:

  1. Multi-protocol by design
  • One format supports:
  • REST
  • GraphQL
  • WebSocket
  • (future) gRPC, AsyncAPI, message buses
  1. Developer-first
  • Readable YAML for humans, strict JSON Schema for machines.
  1. Strong structure, minimal ambiguity
  • No vague fields or implicit semantics.
  • Every field has a precise definition and validation rules.
  1. Transparent evolution
  • All major changes must be clearly documented.
  • Minor changes and clarifications must maintain backward compatibility.

JSON Schema

The canonical, machine-readable definition of UniSpec lives in the schema/ directory.

Rules:

  • Must follow JSON Schema Draft 2020-12
  • Must use $defs for reusable components
  • Must clearly describe field semantics and constraints
  • All examples must validate against the schema
  • Breaking changes require explicit agreement and a major version bump

Documentation

Format specifications

Reference documentation

  • reference/ — Detailed field-by-field reference, versioning, and style guides

Examples

The examples/ directory contains comprehensive examples in JSON format:

Valid Examples (examples/valid/)

  • Specifications (spec/):
    • rest-simple.json — Simple REST user management service
    • graphql-simple.json — GraphQL blog service
    • websocket-simple.json — WebSocket chat service
    • mixed-complete.json — Complete multi-protocol e-commerce service
  • Configurations (config/):
    • simple-multi-service.json — Basic multi-service setup
    • registry-based.json — Configuration using registry references
    • complete-enterprise.json — Full enterprise configuration with environments
    • bearer-token.json — HTTP spec retrieval protected by Bearer token

Invalid Examples (examples/invalid/)

  • Specifications — Various schema violations for testing validation
  • Configurations — Configuration validation errors

All examples are validated as part of CI. See examples/README.md for detailed documentation.

Versioning

UniSpec follows Semantic Versioning (SemVer):

  • MAJOR — breaking changes
  • MINOR — new backward-compatible features
  • PATCH — fixes, clarifications, corrections

All changes must be recorded in CHANGELOG.md.

Format Changes and Contributions

Any change that alters:

  • structure of the UniSpec format
  • semantics of existing fields
  • compatibility rules
  • supported protocols

should be proposed and discussed in a pull request before being applied here.

Installation

# Install dependencies with pnpm
pnpm install

# Or with npm (legacy support)
npm install

Contributing

Contributions are welcome!

To contribute:

  1. Install dependencies: pnpm install
  2. Read the reference docs.
  3. Discuss substantial format changes in an issue or pull request.
  4. Submit a PR with clear explanation and schema validation.

All contributions must preserve backward compatibility unless explicitly approved otherwise.

License

This repository is open-source and free to implement. The UniSpec format is designed to be an open standard.