{"openapi":"3.1.0","info":{"title":"quiz-api","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/quiz/state":{"get":{"summary":"State","description":"The current round, plus this browser's answer to it if it already has one.\n\nReturning the saved answer is what lets the page survive a reload: without it\na refresh shows an empty box and you can't tell whether your answer landed.","operationId":"state_api_quiz_state_get","parameters":[{"name":"voter_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":8,"maxLength":64},{"type":"null"}],"title":"Voter Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/vote":{"post":{"summary":"Vote","operationId":"vote_api_quiz_vote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vote"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/results":{"get":{"summary":"Results","description":"Answers and annotations for one round, for the audience display.\n\nDeliberately unauthenticated: the display page is meant to be opened by\nwhoever you hand the link to. That does mean anyone who can reach the API\ncan read a round's answers, so don't project it before people have voted.","operationId":"results_api_quiz_results_get","parameters":[{"name":"round","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Round"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/agreement":{"get":{"summary":"Agreement","description":"How much the room agrees with itself, over every round so far.\n\nFor each round, take every pair of answers and ask how far apart they are;\nthe numbers below are those pairs pooled across rounds. Pairs are only ever\nformed *within* a round, because two answers to different questions have\nnothing to agree about.","operationId":"agreement_api_quiz_agreement_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/quiz/admin/summary":{"get":{"summary":"Summary","description":"Every round from 1 to the current one, with its raw values.","operationId":"summary_api_quiz_admin_summary_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/admin/annotations":{"get":{"summary":"Get Annotations","description":"Everything staged, including rounds that haven't started yet.\n\nThe summary only reaches as far as the current round, so this is what lets\nthe admin page show a plan prepared in advance.","operationId":"get_annotations_api_quiz_admin_annotations_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Set Annotations","description":"Set (or clear) the correct answer and the named lines for one round.\n\nThe round needn't exist yet: staging ahead is the point, and a round that\nnever arrives simply never gets drawn.","operationId":"set_annotations_api_quiz_admin_annotations_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Annotations"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/admin/annotations/plan":{"post":{"summary":"Set Plan","description":"Replace the whole staged plan in one go.\n\nReplace, not merge: the plan you send is the plan there is, so deleting a\nround from it unstages that round.","operationId":"set_plan_api_quiz_admin_annotations_plan_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/admin/advance":{"post":{"summary":"Advance","operationId":"advance_api_quiz_admin_advance_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quiz/admin/clear":{"post":{"summary":"Clear","operationId":"clear_api_quiz_admin_clear_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Confirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/morse/feed":{"get":{"summary":"Feed","description":"Recent posts, cached.\n\nAn expired cache is handed over immediately and refreshed in the\nbackground, so only the very first visit waits on the network.","operationId":"feed_api_morse_feed_get","parameters":[{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/morse/sources":{"get":{"summary":"Get Sources","operationId":"get_sources_api_morse_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"summary":"Put Sources","operationId":"put_sources_api_morse_sources_put","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sources"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Annotations":{"properties":{"round":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Round"},"answer":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Answer"},"predictions":{"items":{"$ref":"#/components/schemas/Prediction"},"type":"array","maxItems":50,"title":"Predictions","default":[]}},"type":"object","required":["round"],"title":"Annotations"},"Confirm":{"properties":{"confirm":{"type":"string","title":"Confirm"}},"type":"object","required":["confirm"],"title":"Confirm"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Plan":{"properties":{"rounds":{"items":{"$ref":"#/components/schemas/Annotations"},"type":"array","maxItems":100,"title":"Rounds","default":[]}},"type":"object","title":"Plan","description":"The whole staged plan: one entry per round you've prepared."},"Prediction":{"properties":{"name":{"type":"string","maxLength":40,"minLength":1,"title":"Name"},"value":{"type":"number","title":"Value"}},"type":"object","required":["name","value"],"title":"Prediction","description":"One named line drawn over the histogram."},"Source":{"properties":{"url":{"type":"string","maxLength":400,"minLength":8,"title":"Url"},"label":{"type":"string","maxLength":60,"title":"Label","default":""},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["url"],"title":"Source"},"Sources":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/Source"},"type":"array","maxItems":25,"title":"Sources"}},"type":"object","required":["sources"],"title":"Sources"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Vote":{"properties":{"voter_id":{"type":"string","maxLength":64,"minLength":8,"title":"Voter Id"},"round":{"type":"integer","title":"Round"},"value":{"type":"number","title":"Value"},"expertise":{"type":"string","enum":["expert","nonexpert"],"title":"Expertise","default":"expert"}},"type":"object","required":["voter_id","round","value"],"title":"Vote"}}}}