From 00d14413048778610117492b748c346e0c6cdb62 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Tue, 8 Oct 2024 10:21:28 +0200 Subject: [PATCH] put data format --- devcon-api/src/controllers/sessions.ts | 2 + devcon-api/src/swagger/definition.json | 97 +++++++++++++++++++++++++- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/devcon-api/src/controllers/sessions.ts b/devcon-api/src/controllers/sessions.ts index 5a2465e32..ca9048728 100644 --- a/devcon-api/src/controllers/sessions.ts +++ b/devcon-api/src/controllers/sessions.ts @@ -109,6 +109,8 @@ export async function GetSession(req: Request, res: Response) { export async function UpdateSession(req: Request, res: Response) { // #swagger.tags = ['Sessions'] + // #swagger.parameters['body'] = { in: 'body', schema: { id: 'new-title', sourceId: 'PRE123', eventId: 'devcon-6', title: 'New Title', description: 'New Description', track: 'Devcon', type: 'Talk', expertise: 'Intermediate', speakers: ['123', '456'], tags: ['tag1', 'tag2'], keywords: ['keyword1', 'keyword2'], resources_slides: 'https://devcon.org/resources/new-title.pdf', slot_start: 1665495000000, slot_end: 1665498600000, slot_roomId: 'workshop-3', sources_ipfsHash: 'QmTwmiv4u44XLBhbm5BmowKv91HfivDLvpSYaXUt1vmRRG', sources_youtubeId: 'TRoO5fD7TI4', sources_swarmHash: 'e8caa4dd5a1d7a7c8edb7e71933031f29f7feadcea2d2ce017d30c0dceb97850', duration: 3065, language: 'en' } } + const updatedSession = req.body if (!updatedSession) return res.status(400).send({ status: 400, message: 'No Body' }) if (req.params.id !== updatedSession.id) return res.status(400).send({ status: 400, message: 'Invalid Id' }) diff --git a/devcon-api/src/swagger/definition.json b/devcon-api/src/swagger/definition.json index bd0fb81c8..6d534cc59 100644 --- a/devcon-api/src/swagger/definition.json +++ b/devcon-api/src/swagger/definition.json @@ -612,7 +612,102 @@ "type": "object", "properties": { "id": { - "example": "any" + "type": "string", + "example": "new-title" + }, + "sourceId": { + "type": "string", + "example": "PRE123" + }, + "eventId": { + "type": "string", + "example": "devcon-6" + }, + "title": { + "type": "string", + "example": "New Title" + }, + "description": { + "type": "string", + "example": "New Description" + }, + "track": { + "type": "string", + "example": "Devcon" + }, + "type": { + "type": "string", + "example": "Talk" + }, + "expertise": { + "type": "string", + "example": "Intermediate" + }, + "speakers": { + "type": "array", + "example": [ + "123", + "456" + ], + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "example": [ + "tag1", + "tag2" + ], + "items": { + "type": "string" + } + }, + "keywords": { + "type": "array", + "example": [ + "keyword1", + "keyword2" + ], + "items": { + "type": "string" + } + }, + "resources_slides": { + "type": "string", + "example": "https://devcon.org/resources/new-title.pdf" + }, + "slot_start": { + "type": "number", + "example": 1665495000000 + }, + "slot_end": { + "type": "number", + "example": 1665498600000 + }, + "slot_roomId": { + "type": "string", + "example": "workshop-3" + }, + "sources_ipfsHash": { + "type": "string", + "example": "QmTwmiv4u44XLBhbm5BmowKv91HfivDLvpSYaXUt1vmRRG" + }, + "sources_youtubeId": { + "type": "string", + "example": "TRoO5fD7TI4" + }, + "sources_swarmHash": { + "type": "string", + "example": "e8caa4dd5a1d7a7c8edb7e71933031f29f7feadcea2d2ce017d30c0dceb97850" + }, + "duration": { + "type": "number", + "example": 3065 + }, + "language": { + "type": "string", + "example": "en" } } }