Implement getElectionResults

This commit is contained in:
2025-01-14 16:52:20 +01:00
parent 13c2693bdb
commit c095e9ae0b
4 changed files with 118 additions and 1 deletions

View File

@ -124,6 +124,12 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ElectionResultsResponse"
400:
description: Request malformed
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
404:
description: Election doesn't exist
content:
@ -205,6 +211,22 @@ components:
ElectionResultsResponse:
type: object
properties:
results:
type: array
items:
$ref: "#/components/schemas/VotesForChoice"
VotesForChoice:
type: object
required:
- choice
- votes
properties:
choice:
type: string
votes:
type: integer
ErrorResponse:
type: object