Skip to content

Commit

Permalink
put data format
Browse files Browse the repository at this point in the history
  • Loading branch information
wslyvh committed Oct 8, 2024
1 parent a70ccdc commit 00d1441
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 1 deletion.
2 changes: 2 additions & 0 deletions devcon-api/src/controllers/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down
97 changes: 96 additions & 1 deletion devcon-api/src/swagger/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down

0 comments on commit 00d1441

Please sign in to comment.