Skip to content

Instantly share code, notes, and snippets.

@xadhoom
Created June 1, 2023 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xadhoom/bd91ad0e1d5f90b6caa2acb6f1698a93 to your computer and use it in GitHub Desktop.
Save xadhoom/bd91ad0e1d5f90b6caa2acb6f1698a93 to your computer and use it in GitHub Desktop.
components:
responses:
UnauthorizedError:
description: Access token missing or invalid
schemas:
Post:
additionalProperties: false
description: A post
properties:
content:
type: string
required:
- content
title: Post
type: object
PostsCollection:
default: []
description: A collection of posts
title: PostsCollection
type: array
items:
$ref: '#/components/schemas/Post'
User:
additionalProperties: false
properties:
posts:
$ref: '#/components/schemas/PostsCollection'
email:
description: The user email address
type: string
username:
description: The user username.
type: string
title: User
type: object
securitySchemes:
bearerToken:
scheme: bearer
type: http
info:
description: This is a test
title: Test API
version: '1.0'
openapi: 3.0.0
paths:
/api/v1/users:
get:
operationId: getUsers
responses:
'200':
description: Some users
content:
application/json:
schema:
type: array
items:
additionalProperties: false
properties:
posts:
$ref: '#/components/schemas/PostsCollection'
email:
description: The user email address
type: string
username:
description: The user username.
type: string
title: User
type: object
tags:
- users
security:
- bearerToken: []
servers:
- url: '{endpoint_url}'
variables:
endpoint_url:
default: https://localhost:5443/
tags: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment