{ "components": { "schemas": { "competition": { "description": "A competition is a race game for the competitors to collect more vote points.", "properties": { "guid": { "type": "string", "format": "uuid", "description": "Internal unique identifier for this competition." }, "name": { "type": "string" }, "status": { "$ref": "#/components/schemas/CompetitionStatus" }, "start_at": { "type": "string", "format": "date-time" }, "end_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } }, "required": [ "guid", "status", "start_at", "end_at", "created_at", "updated_at" ], "type": "object" }, "competition_participant": { "description": "The competition participant is a competitor who is playing in a specific competition and he/she be able to win that.", "properties": { "guid": { "type": "string", "format": "uuid", "description": "Internal unique identifier for this competition_participant." }, "competition_id": { "type": "string", "format": "uuid" }, "competitor_id": { "type": "string", "format": "uuid" } }, "required": [ "guid", "competition_id", "competitor_id" ], "type": "object" }, "competitor": { "description": "The competitor can who can participate in a competition.", "properties": { "guid": { "type": "string", "format": "uuid", "description": "Internal unique identifier for this competitor." }, "name": { "type": "string" } }, "required": [ "guid", "name" ], "type": "object" }, "vote": { "description": "The vote is created by voter and it concern for a competition_participant", "properties": { "guid": { "type": "string", "format": "uuid", "description": "Internal unique identifier for this voter." }, "competition_participant_id": { "type": "string", "format": "uuid" }, "voter_id": { "type": "string", "format": "uuid" }, "type": { "type": "string" }, "points": { "type": "integer" } }, "required": [ "guid", "competition_participant_id", "voter_id", "type", "points" ], "type": "object" }, "voter": { "description": "The voter can vote for competition_participant.", "properties": { "guid": { "type": "string", "format": "uuid", "description": "Internal unique identifier for this voter." }, "name": { "type": "string" } }, "required": [ "guid", "name" ], "type": "object" }, "CompetitionStatus": { "description": "Possible values: pending,active,closed.", "enum": [ "pending", "active", "closed" ], "type": "string" } } }, "info": { "contact": {}, "description": "A fictional API for ApiBuilder tool features testing.", "license": {}, "termsOfService": "", "title": "Competition API From Swagger", "version": "0.0.1-swagger" }, "openapi": "3.0.2", "paths": { "/competitors": { "post": { "operationId": "post--competitors", "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/competitor" } } } }, "responses": { "201": { "description": "201 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/competitor" } } }, "headers": {} } }, "tags": [ "competitor" ] } }, "/competitors/:id": { "get": { "operationId": "get--competitors-id", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "200 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/competitor" } } }, "headers": {} } }, "tags": [ "competitor" ] } }, "/competitions": { "post": { "operationId": "post--competitions", "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/competition" } } } }, "responses": { "201": { "description": "201 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/competition" } } }, "headers": {} } }, "tags": [ "competition" ] } }, "/competitions/:id": { "get": { "operationId": "get--competitions-id", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string" }, "name": "id" } ], "responses": { "200": { "description": "200 response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/competition" } } }, "headers": {} } }, "tags": [ "competition" ] } } }, "servers": [ {} ] }