jsonapi

Validate Next.js API responses for JSON:API v1.1 schema adherence.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/dtaborda/startup-saas-template --skill jsonapi-dtaborda
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jsonapi
Source: https://github.com/dtaborda/startup-saas-template/tree/main/skills/jsonapi
Command: npx skills add https://github.com/dtaborda/startup-saas-template --skill jsonapi-dtaborda

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill keeps Next.js API route handlers aligned to the JSON:API v1.1 specification and prevents inconsistent responses, headers, or relationships that would break downstream consumers.

Core Features & Use Cases

  • Strict Document Validation: Enforces that responses never mix data and errors, always include type and id strings, and populate correct relationship links.
  • Header and Query Guardrails: Demands Content-Type and Accept headers of application/vnd.api+json, rejects unsupported sort, include, and fields parameters, and maps HTTP verbs to the mandated status codes.
  • Review Use Case: Apply it when updating providers, relationships, or pagination so every Next.js route handler in ui/app/api mirrors JSON:API behavior before merging.

Quick Start

Use the jsonapi skill to review your updated route handler and confirm every response, header, and relationship matches the latest JSON:API rules before deploying.

Frequently Asked Questions about jsonapi

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

FAQPage Schema
How do I validate Next.js API route handlers for JSON:API compliance?

Validate Next.js API route handlers by checking responses against the JSON:API v1.1 schema to ensure strict adherence. This process confirms correct headers, kebab-case types, string ids, and proper relationship links before deployment.

What HTTP headers are required for JSON:API v1.1 endpoints?

JSON:API v1.1 endpoints require application/vnd.api+json for both Accept and Content-Type headers. Enforcing these headers prevents inconsistent responses and ensures downstream consumers process data correctly.

How do I enforce correct HTTP status codes and error formats in Next.js route handlers?

Enforce correct HTTP status codes in Next.js route handlers by mapping HTTP verbs to mandated codes. Guarantee error arrays include string statuses and source pointers, ensuring responses never mix data and errors.

Does JSON:API validation support query parameters like includes and pagination?

JSON:API validation supports query parameters by rejecting unsupported sort, include, and fields parameters. It validates pagination and relationship updates within route handlers to guarantee consistent JSON:API behavior.

What is the best way to review Next.js API responses for strict schema adherence?

The best way to review Next.js API responses is applying strict document validation during route handler modification. This ensures every response, header, and relationship mirrors JSON:API v1.1 rules before merging.