68 lines
1.6 KiB
YAML
68 lines
1.6 KiB
YAML
/posts:
|
|
get:
|
|
operationId: getAllPosts
|
|
tags:
|
|
- posts
|
|
summary: Get all posts
|
|
description: Retrieve a list of all posts
|
|
parameters:
|
|
- name: limit
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
default: 30
|
|
- name: skip
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
default: 0
|
|
responses:
|
|
'200':
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
posts:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Post'
|
|
total:
|
|
type: integer
|
|
post:
|
|
operationId: createPost
|
|
tags:
|
|
- posts
|
|
summary: Add a new post
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Post'
|
|
responses:
|
|
'201':
|
|
description: Post created successfully
|
|
/posts/{id}:
|
|
get:
|
|
operationId: getPostById
|
|
tags:
|
|
- posts
|
|
summary: Get a single post
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Successful response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Post'
|