Install
openclaw skills install json-to-apiUse 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.
openclaw skills install json-to-apiUse 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-apiDefault 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/expandAdds 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 Shape | HTTP Method | Endpoint |
|---|---|---|
| Single object | GET | GET /{resource}/{id} |
| Array of objects | GET (list), POST (create) | GET /{resource}, POST /{resource} |
| Nested resource | GET | GET /{resource}/{id}/{sub-resource} |
| Object with ID field | PUT, PATCH, DELETE | PUT /{resource}/{id} |
Generate the full OpenAPI spec:
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:
| Scenario | Bad Output | Good Output |
|---|---|---|
| Array of users | GET /user (singular) | GET /users (plural) |
| Nested address object | Flattened into user object | GET /users/{id}/addresses as sub-resource |
| Optional phone field | Marked as required | Marked optional with nullable: true |
| Created timestamp | Number type | String with format: date-time |
references/ — OpenAPI 3.0 schema templates, HTTP method conventions, status code guide