Skip to content

Instantly share code, notes, and snippets.

@TimonVS
Created July 13, 2023 12:59
Show Gist options
  • Save TimonVS/8c415b86347d370454edb6c873fe32ad to your computer and use it in GitHub Desktop.
Save TimonVS/8c415b86347d370454edb6c873fe32ad to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Sample API
version: 1.0.0
servers:
- url: http://api.example.com/v1
paths:
/users:
get:
summary: Returns a list of users.
responses:
'200': # status code
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
/users/{id}:
get:
summary: Returns a user.
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: The user ID.
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: integer
name:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment