blong-validation

Generate runtime validation and OpenAPI docs from TypeScript types or TypeBox schemas.

1|Updated Dec 21, 2023
One-click install
npx skills add https://github.com/feasibleone/blong --skill blong-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: blong-validation
Source: https://github.com/feasibleone/blong/tree/main/.github/skills/validation
Command: npx skills add https://github.com/feasibleone/blong --skill blong-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Blong validation enforces consistent input and output contracts for Blong handlers, preventing runtime errors and ensuring API behavior matches documentation.

Core Features & Use Cases

  • Automatic validation derived from TypeScript types or TypeBox schemas that also powers OpenAPI documentation.
  • Runtime checks for parameters and responses, with automatic updates to API docs as types evolve.
  • Use Case: When adding a new endpoint, define the contract once and rely on the framework to validate inputs, validate outputs, and generate OpenAPI specs.

Quick Start

Install the validation package, define a Handler type using TypeScript, and enable automatic validation in your server setup. Then run your app and observe runtime validation errors appear alongside updated OpenAPI docs.

Frequently Asked Questions about blong-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate TypeScript API validation and OpenAPI docs generation?

You can automate TypeScript API validation by defining handler contracts once using TypeScript types or TypeBox schemas, which automatically generates runtime checks and OpenAPI documentation.

What is the best way to keep API parameters and OpenAPI specs in sync?

Keeping API parameters and OpenAPI specs in sync is achieved by deriving runtime validation checks directly from your TypeScript types or TypeBox schemas, ensuring documentation updates automatically as types evolve.

Does Blong validation work with TypeBox schemas for runtime checks?

Yes, Blong validation supports TypeBox schemas for runtime checks, allowing you to enforce consistent input and output contracts while simultaneously powering your OpenAPI documentation.

How do I set up runtime checks for API responses in a TypeScript project?

To set up runtime checks for API responses, install the validation package, define your Handler types using TypeScript or TypeBox, and enable automatic validation in your server setup to validate outputs.

Why do my API parameters fail runtime validation in TypeScript?

API parameters fail runtime validation when incoming requests do not match the defined TypeScript types or TypeBox schemas, triggering errors that highlight mismatches between the actual data and your enforced contracts.

Can I generate OpenAPI documentation from TypeScript types automatically?

Yes, you can automatically generate OpenAPI documentation from TypeScript types by enabling the framework's validation feature, which derives the specs from the same schemas used for runtime checks.