Skip to content
Snippets Groups Projects
Verified Commit 74edc206 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Specifikace pro posty

parent edd1172a
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,11 @@ servers: ...@@ -19,6 +19,11 @@ servers:
description: Production server description: Production server
components: components:
securitySchemes:
Bearer:
name: Authorization
in: header
type: apiKey
schemas: schemas:
ProgramScheduleEntry: ProgramScheduleEntry:
type: object type: object
...@@ -39,22 +44,83 @@ components: ...@@ -39,22 +44,83 @@ components:
description: description:
type: string type: string
nullable: true nullable: true
expectedStartAt: expected_start_at:
type: string type: string
expectedFinishAt: expected_finish_at:
type: string type: string
nullable: true nullable: true
securitySchemes: Ranking:
Bearer: type: object
name: Authorization properties:
in: header score:
type: apiKey type: integer
likes:
type: integer
dislikes:
type: integer
my_vote:
type: integer
Author:
type: object
properties:
name:
type: string
group:
type: string
DiscussionPost:
type: object
description: Prispevek do rozpravy
properties:
id:
type: integer
readOnly: true
datetime:
type: string
is_archived:
type: boolean
content:
type: string
author:
$ref: '#/components/schemas/Author'
ranking:
$ref: '#/components/schemas/Ranking'
ProposalPost:
type: object
description: NavrhPostupu
properties:
id:
type: integer
readOnly: true
datetime:
type: string
is_archived:
type: boolean
content:
type: string
author:
$ref: '#/components/schemas/Author'
ranking:
$ref: '#/components/schemas/Ranking'
# responses:
# Unauthorized:
# description: Unauthorized
# schema:
# $ref: '#/definitions/ErrorResponse'
# Forbidden:
# description: Forbidden
# schema:
# $ref: '#/definitions/ErrorResponse'
# NotFound:
# description: The specified resource was not found
# schema:
# $ref: '#/definitions/ErrorResponse'
paths: paths:
/program: /program:
get: get:
x-mojo-to: program#entries
tags: tags:
- program - programm
summary: "Program zasedani" summary: "Program zasedani"
operationId: getProgram operationId: getProgram
responses: responses:
...@@ -66,4 +132,57 @@ paths: ...@@ -66,4 +132,57 @@ paths:
type: array type: array
items: items:
$ref: '#/components/schemas/ProgramScheduleEntry' $ref: '#/components/schemas/ProgramScheduleEntry'
x-mojo-to: program#entries /posts:
post:
x-mojo-to: posts#create
security:
- Bearer: ['member', 'regp']
tags:
- posts
summary: "Pridat zpravu"
operationId: createPost
requestBody:
content:
application/json:
schema:
type: object
properties:
type:
type: integer
enum: [0, 1]
content:
type: string
required:
- type
- content
responses:
201:
description: Post created
content:
application/json:
schema:
type: object
properties:
id:
type: integer
description: Post id
get:
x-mojo-to: posts#list
security:
- Bearer: []
tags:
- posts
summary: "Zpravy"
operationId: getPosts
responses:
200:
description: Posts
content:
application/json:
schema:
type: array
items:
oneOf:
- $ref: '#/components/schemas/DiscussionPost'
- $ref: '#/components/schemas/ProposalPost'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment