Skip to content

Commit

Permalink
#32 Refactored OpenAPI spec a little (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman authored Apr 11, 2024
1 parent 4aa9804 commit 4cf680f
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions botalka/src/main/resources/static/openapi/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ components:
example: 2024-04-14T13:32:42Z
HomeworkDraft:
type: object
required:
- title
- description
- max_score
- publication_moment
properties:
title:
$ref: '#/components/schemas/HomeworkTitle'
Expand All @@ -244,28 +239,23 @@ components:
$ref: '#/components/schemas/HomeworkScore'
publication_moment:
$ref: '#/components/schemas/HomeworkPublicationMoment'
Homework:
type: object
required:
- id
- title
- description
- max_score
- publication_moment
- creation_moment
properties:
id:
$ref: '#/components/schemas/HomeworkId'
title:
$ref: '#/components/schemas/HomeworkTitle'
description:
$ref: '#/components/schemas/HomeworkDescription'
max_score:
$ref: '#/components/schemas/HomeworkScore'
publication_moment:
$ref: '#/components/schemas/HomeworkPublicationMoment'
creation_moment:
$ref: '#/components/schemas/CreationMoment'
Homework:
allOf:
- $ref: '#/components/schemas/HomeworkDraft'
- type: object
properties:
id:
$ref: '#/components/schemas/HomeworkId'
creation_moment:
$ref: '#/components/schemas/CreationMoment'
required:
- id
- creation_moment
UserId:
type: integer
description: A unique key for a user at the entire system
Expand All @@ -275,12 +265,12 @@ components:
description: Short human readable unique name of the user
example: vityaman
UserDraft:
required:
- alias
type: object
properties:
alias:
$ref: '#/components/schemas/UserAlias'
required:
- alias
UserRole:
type: string
enum:
Expand Down Expand Up @@ -329,6 +319,7 @@ components:
- status
PromotionRequest:
allOf:
- $ref: '#/components/schemas/PromotionRequestDraft'
- type: object
properties:
id:
Expand All @@ -341,25 +332,24 @@ components:
- id
- user_id
- status
- $ref: '#/components/schemas/PromotionRequestDraft'
NoteDraft:
required:
- content
type: object
properties:
content:
type: string
Note:
type: object
required:
- id
- content
Note:
type: object
properties:
id:
type: integer
format: int64
content:
type: string
required:
- id
- content
GeneralError:
type: object
properties:
Expand All @@ -376,3 +366,7 @@ components:
type: string
description: Detailed Message
example: Username must contain only latin letter
required:
- code
- status
- message

0 comments on commit 4cf680f

Please sign in to comment.