Add Pagination Object on OpenApi

This commit is contained in:
2019-08-30 22:33:34 +02:00
parent 9e88b33595
commit 52dfaaf814

View File

@@ -84,9 +84,14 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: array allOf:
items: - $ref: '#/components/schemas/Paginated'
$ref: '#/components/schemas/CitizenResponse' - type: object
properties:
result:
type: array
items:
$ref: '#/components/schemas/CitizenResponse'
/articles: /articles:
get: get:
@@ -106,9 +111,14 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: array allOf:
items: - $ref: '#/components/schemas/Paginated'
$ref: '#/components/schemas/ArticleResponse' - type: object
properties:
result:
type: array
items:
$ref: '#/components/schemas/ArticleResponse'
post: post:
security: security:
- JWTAuth: [] - JWTAuth: []
@@ -171,9 +181,14 @@ paths:
content: content:
application/json: application/json:
schema: schema:
type: array allOf:
items: - $ref: '#/components/schemas/Paginated'
$ref: '#/components/schemas/ConstitutionResponse' - type: object
properties:
result:
type: array
items:
$ref: '#/components/schemas/ConstitutionResponse'
post: post:
security: security:
- JWTAuth: [] - JWTAuth: []
@@ -519,6 +534,33 @@ components:
version_id: version_id:
$ref: '#/components/schemas/UUID' $ref: '#/components/schemas/UUID'
Paginated:
properties:
result:
type: array
items:
$ref: '#/components/schemas/UuidEntity'
count:
type: integer
minimum: 0
example: 1
currentPage:
type: integer
minimum: 0
example: 1
limit:
type: integer
minimum: 0
example: 50
offset:
type: integer
minimum: 0
example: 1
total:
type: integer
minimum: 0
example: 1
UserBase: UserBase:
properties: properties:
username: username: