mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-25 19:48:45 +00:00
Rewrite crud.yml
This commit is contained in:
parent
1c52e04cdb
commit
9fb8626d8c
@ -1,7 +1,7 @@
|
||||
swagger: "2.0"
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
description: "This is a template for the CRUD repositories from [microutils](https://github.com/InsanusMokrassar/MicroUtils/tree/master/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/crud)"
|
||||
version: "0.11.0"
|
||||
version: "0.11.3"
|
||||
title: "CRUD Repo"
|
||||
contact:
|
||||
email: "ovsyannikov.alexey95@gmail.com"
|
||||
@ -11,61 +11,35 @@ tags:
|
||||
- name: "Write"
|
||||
description: "Operations with `post` request in most cases"
|
||||
|
||||
components:
|
||||
parameters:
|
||||
IdInQuery:
|
||||
in: "query"
|
||||
name: "id"
|
||||
allOf:
|
||||
- $ref: "#/definitions/Key"
|
||||
IdsInBody:
|
||||
in: "body"
|
||||
name: "body"
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/Key"
|
||||
NewValuesInBody:
|
||||
in: "body"
|
||||
name: "body"
|
||||
type: array
|
||||
allOf:
|
||||
- $ref: "#/definitions/NewValues"
|
||||
NewValuesWithIdsInBody:
|
||||
in: "body"
|
||||
name: "body"
|
||||
type: array
|
||||
items:
|
||||
allOf:
|
||||
- $ref: "#/definitions/Pair"
|
||||
- properties:
|
||||
first:
|
||||
$ref: "#/definitions/Key"
|
||||
second:
|
||||
$ref: "#/definitions/NewValue"
|
||||
schema:
|
||||
$ref: "#/components/schemas/Key"
|
||||
PaginationInQueryPage:
|
||||
in: "query"
|
||||
type: integer
|
||||
name: "ppage"
|
||||
description: "Page of pagination"
|
||||
schema:
|
||||
type: integer
|
||||
required: false
|
||||
PaginationInQuerySize:
|
||||
in: "query"
|
||||
type: integer
|
||||
name: "psize"
|
||||
description: "Size of each page in pagination"
|
||||
schema:
|
||||
type: integer
|
||||
required: false
|
||||
schemas:
|
||||
|
||||
|
||||
definitions:
|
||||
Key:
|
||||
type: integer
|
||||
description: "REWRITE THIS TYPE AS KEY IN SWAGGER FILE"
|
||||
Value:
|
||||
type: integer
|
||||
description: "REWRITE THIS TYPE AS VALUE IN SWAGGER FILE"
|
||||
Values:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/Value"
|
||||
NewValue:
|
||||
type: integer
|
||||
description: "REWRITE THIS TYPE AS NEW VALUE IN SWAGGER FILE"
|
||||
@ -75,10 +49,6 @@ definitions:
|
||||
properties:
|
||||
first:
|
||||
second:
|
||||
NewValues:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/definitions/NewValue"
|
||||
PaginationResult:
|
||||
type: object
|
||||
properties:
|
||||
@ -103,30 +73,34 @@ paths:
|
||||
tags:
|
||||
- "Read"
|
||||
parameters:
|
||||
- $ref: "#/parameters/PaginationInQueryPage"
|
||||
- $ref: "#/parameters/PaginationInQuerySize"
|
||||
- $ref: "#/components/parameters/PaginationInQueryPage"
|
||||
- $ref: "#/components/parameters/PaginationInQuerySize"
|
||||
responses:
|
||||
"200":
|
||||
description: "Pagination with elements"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: "#/definitions/PaginationResult"
|
||||
- $ref: "#/components/schemas/PaginationResult"
|
||||
- properties:
|
||||
results:
|
||||
items:
|
||||
$ref: "#/definitions/Value"
|
||||
$ref: "#/components/schemas/Value"
|
||||
/getById:
|
||||
get:
|
||||
tags:
|
||||
- "Read"
|
||||
parameters:
|
||||
- $ref: "#/parameters/IdInQuery"
|
||||
- $ref: "#/components/parameters/IdInQuery"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: "Result object"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/definitions/Value"
|
||||
$ref: "#/components/schemas/Value"
|
||||
"204":
|
||||
description: "No value by id"
|
||||
/contains:
|
||||
@ -134,11 +108,13 @@ paths:
|
||||
tags:
|
||||
- "Read"
|
||||
parameters:
|
||||
- $ref: "#/parameters/IdInQuery"
|
||||
- $ref: "#/components/parameters/IdInQuery"
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: "Object with id availability in repo"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: boolean
|
||||
/count:
|
||||
@ -148,6 +124,8 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: "Amount of objects in repo"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: integer
|
||||
|
||||
@ -156,32 +134,65 @@ paths:
|
||||
post:
|
||||
tags:
|
||||
- "Write"
|
||||
parameters:
|
||||
- $ref: "#/parameters/NewValuesInBody"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/NewValue"
|
||||
responses:
|
||||
"200":
|
||||
description: "Objects has been created and saved"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/definitions/Values"
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Value"
|
||||
/update:
|
||||
post:
|
||||
tags:
|
||||
- "Write"
|
||||
parameters:
|
||||
- $ref: "#/parameters/NewValuesWithIdsInBody"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/Pair"
|
||||
- properties:
|
||||
first:
|
||||
$ref: "#/components/schemas/Key"
|
||||
second:
|
||||
$ref: "#/components/schemas/NewValue"
|
||||
responses:
|
||||
"200":
|
||||
description: "Objects has been updated"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/definitions/Values"
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Value"
|
||||
/deleteById:
|
||||
post:
|
||||
tags:
|
||||
- "Write"
|
||||
parameters:
|
||||
- $ref: "#/parameters/IdsInBody"
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Key"
|
||||
responses:
|
||||
"200":
|
||||
description: "Objects has been updated"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/definitions/Values"
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/Value"
|
||||
|
Loading…
Reference in New Issue
Block a user