OpenAPI examples: a minimal spec and a full-feature demo
The fastest way to learn OpenAPI is to read working documents. Here is the smallest useful
one — a single GET endpoint returning JSON:
openapi: 3.0.3
info:
title: My API
version: 1.0.0
servers:
- url: https://api.example.com/v1
paths:
/hello:
get:
summary: Say hello
parameters:
- name: name
in: query
schema:
type: string
responses:
'200':
description: A friendly greeting
content:
application/json:
schema:
type: object
properties:
message:
type: string
Paste it into the OASForge editor and it renders as interactive documentation instantly — "Try it out" even works, answered by the built-in mock server.
A full-feature OpenAPI 3.1 example
For everything past hello-world, OASForge ships a deliberately exhaustive demo: a fictional e-commerce API written to exercise every construct Swagger UI can render:
- All HTTP methods, deprecated operations, external docs
- Path, query, header and cookie parameters with styles (
deepObject,pipeDelimited) - JSON bodies with named examples, form-urlencoded, multipart file upload, XML, plain text
oneOf/anyOf/allOfwith discriminators, recursive schemas,readOnly/writeOnly- Callbacks and OpenAPI 3.1 webhooks
- API key, HTTP Basic, Bearer JWT, OAuth 2.0 flows and OpenID Connect security schemes
Open the demo in the preview, then use Edit a copy to turn it into your own editable document — the ready-made spec doubles as a starting template.
No signup, no install — the editor runs entirely in your browser.
Start in the editor