{ "swagger": "2.0", "info": { "title": "Competition API From Swagger", "description": "A fictional API for ApiBuilder tool features testing.", "contact": { "name": "Daniel Drescher", "email": "daniel.drescher@doclerholding.com" }, "version": "0.0.4-dev" }, "basePath": "competition-api.product-domain.com", "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/competitions": { "post": { "parameters": [ { "name": "competition", "in": "body", "schema": { "$ref": "#/definitions/competition" } } ], "responses": { "201": { "description": "201 response", "schema": { "$ref": "#/definitions/competition" } } } } }, "/competitions/{id}": { "get": { "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/competition" } } } } }, "/competitors": { "post": { "parameters": [ { "name": "competitor", "in": "body", "schema": { "$ref": "#/definitions/competitor" } } ], "responses": { "201": { "description": "201 response", "schema": { "$ref": "#/definitions/competitor" } } } } }, "/competitors/{id}": { "get": { "parameters": [ { "name": "id", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/competitor" } } } } } }, "definitions": { "competition": { "type": "object", "description": "A competition is a race game for the competitors to collect more vote points.", "title": "competition", "required": [ "guid", "status", "start_at", "end_at", "created_at", "updated_at" ], "properties": { "guid": { "description": "Internal unique identifier for this competition.", "type": "string", "format": "uuid" }, "name": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "active", "closed" ] }, "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" } } }, "competition_participant": { "type": "object", "description": "The competition participant is a competitor who is playing in a specific competition and he/she be able to win that.", "title": "competition_participant", "required": [ "guid", "competition_id", "competitor_id" ], "properties": { "guid": { "description": "Internal unique identifier for this competition_participant.", "type": "string", "format": "uuid" }, "competition_id": { "type": "string", "format": "uuid" }, "competitor_id": { "type": "string", "format": "uuid" } } }, "competitor": { "type": "object", "description": "The competitor can who can participate in a competition.", "title": "competitor", "required": [ "guid", "name" ], "properties": { "guid": { "description": "Internal unique identifier for this competitor.", "type": "string", "format": "uuid" }, "name": { "type": "string" } } }, "vote": { "type": "object", "description": "The vote is created by voter and it concern for a competition_participant", "title": "vote", "required": [ "guid", "competition_participant_id", "voter_id", "type", "points" ], "properties": { "guid": { "description": "Internal unique identifier for this voter.", "type": "string", "format": "uuid" }, "competition_participant_id": { "type": "string", "format": "uuid" }, "voter_id": { "type": "string", "format": "uuid" }, "type": { "type": "string" }, "points": { "type": "integer", "format": "int32" } } }, "voter": { "type": "object", "description": "The voter can vote for competition_participant.", "title": "voter", "required": [ "guid", "name" ], "properties": { "guid": { "description": "Internal unique identifier for this voter.", "type": "string", "format": "uuid" }, "name": { "type": "string" } } } } }