Test openapi schema of /articles/{article}/comments

This commit is contained in:
2021-03-17 17:48:42 +01:00
parent 42dbd940a0
commit 07ae50c40a
7 changed files with 142 additions and 51 deletions

View File

@@ -470,6 +470,41 @@ paths:
/articles/{article}/comments:
parameters:
- $ref: '#/components/parameters/article'
get:
summary: Get comments of one article
tags:
- comment
- article
parameters:
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/search'
- name: sort
in: query
required: false
example:
- created_at
- votes
schema:
type: string
default: created_at
enum:
- created_at
- votes
responses:
200:
description: Return Comment and children
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/Paginated'
- type: object
properties:
result:
type: array
items:
$ref: '#/components/schemas/CommentResponse'
post:
security:
- JWTAuth: [ ]