OpenAPI Integration
Use json-render to generate dynamic forms and UIs from OpenAPI/Swagger schemas.
Concept: This page demonstrates how json-render can support OpenAPI schemas. The examples are illustrative and may require adaptation for production use.
Why OpenAPI?
OpenAPI specifications describe your API's endpoints, request bodies, and response schemas. By converting OpenAPI schemas to json-render specs, you can:
- Automatically generate forms for API endpoints
- Display API responses with type-aware rendering
- Keep your UI in sync with your API schema
- Let AI generate UIs that match your API contracts
Example OpenAPI Schema
A typical OpenAPI schema for a request body:
Define an OpenAPI-to-UI Catalog
Create components that map to OpenAPI data types:
Convert OpenAPI Schema to Spec
Transform OpenAPI schemas into json-render specs by recursively walking the schema properties and mapping each type to the corresponding catalog component. The converter handles nested objects, enums, arrays, and all primitive types.
Usage Example
Auto-generating from OpenAPI Document
Load and parse an OpenAPI document to generate forms for all operations:
Next
Learn about streaming for progressive UI rendering.