Use when (1) user provides JSON data and asks to design a REST API endpoint around it. (2) user says "create an API for this", "design an endpoint", "write the OpenAPI spec for this JSON", or "make this a web API". (3) user pastes a JSON payload and wants the corresponding request/response schema.
This skill solves the specific problem of: raw JSON data needs a proper API contract — endpoints, HTTP methods, status codes, and schemas — not just a data dump.
This skill IS NOT:
This skill IS activated ONLY when: JSON data + API design intent are both present.
/json-to-api#Default mode. Designs REST API endpoints from JSON data with full OpenAPI 3.0 spec.
When to use: User provides JSON and wants endpoint design, HTTP methods, and request/response schemas.
/json-to-api/expand#Adds pagination, filtering, sorting, and embedded resource support to the base design.
When to use: The JSON represents a collection and user wants a production-grade API surface.
Determine resources and endpoints:
JSON ShapeHTTP MethodEndpointSingle objectGETGET /{resource}/{id}Array of objectsGET (list), POST (create)GET /{resource}, POST /{resource}Nested resourceGETGET /{resource}/{id}/{sub-resource}Object with ID fieldPUT, PATCH, DELETEPUT /{resource}/{id}
Generate the full OpenAPI spec:
yaml
openapi: 3.0.0
info:
title: Resource API
version: 1.0.0
paths:
/resources:
get:
summary: List all resources
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Resource'
For each schema field:
example values from the provided JSON/users, not /user)example in the schemaA good output:
A bad output:
ScenarioBad OutputGood OutputArray of usersGET /user (singular)GET /users (plural)Nested address objectFlattened into user objectGET /users/{id}/addresses as sub-resourceOptional phone fieldMarked as requiredMarked optional with nullable: trueCreated timestampNumber typeString with format: date-time
references/ — OpenAPI 3.0 schema templates, HTTP method conventions, status code guide