Back to blog

Reva: Validate requests with OpenAPI in Node.js

Validating API requests shouldn't be a hassle. Why write validation code by hand when we have OpenAPI documents that describe every endpoint? To address this problem we built Reva, a simple Node.js request validator based on OpenAPI.

Elias MeireElias Meire

Elias Meire

2 min read
Reva: Validate requests with OpenAPI in Node.js

Validating API requests shouldn't be a hassle. Why write validation code by hand when we have OpenAPI documents that describe every endpoint? To address this problem we built Reva, a simple Node.js request validator based on OpenAPI.

As an API-first company, we try to deliver the best developer experience possible with our APIs. API validation has a huge role to play in DX. Developers should get immediate and precise feedback when their requests aren't valid. Reva leverages our public OpenAPI specifications to do exactly that.

Here are some highlights of @apideck/reva

  • Complete: Reva validates all OpenAPI parameter types and request body
  • 😄 Human-readable error messages powered by our better-ajv-errors package.
  • 🧩 Flexible: works with any Node.js framework and serverless provider
  • 🪶 Small footprint: < 50kB
  • 👩‍💻 High quality TypeScript definitions

Ready to try it out? Install Reva through npm.

npm i @apideck/reva

Using Reva

After installing Reva, import the Reva class, and create a new instance.

To validate a request you need a request object and an OpenAPI operation. No need to load a complete OpenAPI document to validate a single endpoint.

A request can have the following properties: body, queryParameters, pathParameters and headers. None of them are required. You can, for example, use Reva to only validate query parameters.

import { Reva } from '@apideck/reva';

const reva = new Reva();

const result = reva.validate({
  operation, // OpenAPI operation
  request: {
    headers: { 'X-My-Header': 'value', Cookie: 'Key=Value' },
    pathParameters; { id: 'ed55e7a3' },
    queryParameters; { search: 'foo' },
    body: {},
  },
});

if (result.ok) {
  // Valid request!
} else {
  // Invalid request, result.errors contains validation errors
  console.log(result.errors);
}

Detailed docs can be found on GitHub.

Feedback welcome

We built Reva to solve our own need for easy validation based on OpenAPI. We hope you find it useful too. Any feedback is welcome, looking forward to collaborate further on GitHub.

Ready to get started?

Scale your integration strategy and deliver the integrations your customers need in record time.

Ready to get started?
Talk to an expert

Trusted by fast-moving product & engineering teams

JobNimbus
Blue Zinc
Drata
Octa
Nmbrs
Apideck Blog

Insights, guides, and updates from Apideck

Discover company news, API insights, and expert blog posts. Explore practical integration guides and tech articles to make the most of Apideck's platform.

NetSuite Integration Guide
AccountingGuides & Tutorials

NetSuite Integration Guide

In this deep dive, we break down what NetSuite integration actually looks like in production, from sync patterns and API options to governance limits, concurrency constraints, and the real issues teams run into at scale. With architecture principles, clear decision frameworks, and hands on implementation tips, you’ll walk away with a practical blueprint for building NetSuite integrations that are reliable, secure, and built to handle growth.

Kateryna Poryvay

Kateryna Poryvay

15 min read
Introducing the Intuit Enterprise Suite Connector
AccountingCompany news

Introducing the Intuit Enterprise Suite Connector

Intuit Enterprise Suite (IES) is Intuit’s AI-powered, cloud-native ERP for mid-market, multi-entity businesses that have outgrown QuickBooks Online. Apideck now supports full IES integration through its Unified Accounting API, allowing SaaS and fintech platforms to connect IES alongside QuickBooks Online and 20+ other ERPs.

GJ

GJ

7 min read
Xero API Pricing and the App Partner Program
AccountingIndustry insightsGuides & Tutorials

Xero API Pricing and the App Partner Program

Xero's new API pricing starts March 2026. Compare tiers, costs vs QuickBooks and Sage, plus 6 optimization strategies to reduce your integration expenses.

GJ

GJ

9 min read