Skip to content

Instantly share code, notes, and snippets.

@scampiuk
Last active September 23, 2019 21:39
Simple OpenAPI 3 spec
openapi: "3.0.0"
info:
title: Simple API overview
version: 2.0.0
paths:
/:
get:
summary: Show the version of the API
responses:
'200':
$ref: '#/components/responses/VersionResponse'
components:
responses:
VersionResponse:
description: Version response object
headers:
X-Request-Id:
$ref: '#/components/headers/X-Request-Id'
content:
application/json:
schema:
$ref: "#/components/schemas/Version"
headers:
X-Request-Id:
required: true
description: unique ID for the request
schema:
$ref: '#/components/schemas/XRequestId'
schemas:
Version:
type: object
required:
- version
properties:
version:
type: string
example: 1.23.45
pattern: ^\d\.\d\.\d$
XRequestId:
description: unique ID for the request
type: string
format: uuid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment