{"openapi":"3.0.1","info":{"title":"YourMaps API","version":"1"},"servers":[{"url":"https://yourmaps.io","description":"Generated server url"}],"tags":[{"name":"Status","description":"API for checking server status"},{"name":"Pipeline","description":"API for pipeline processing and results download"},{"name":"Graph","description":"API for manipulating processing graphs"}],"paths":{"/api/v1/graph/validate":{"post":{"tags":["Graph"],"summary":"Validates a graph","description":"Performs a number of checks on a graph and returns a list of errors, or empty list if graph is valid","operationId":"validate","requestBody":{"description":"ReteGraph JSON structure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReteGraph"},"example":{"id":"mapverse@0.1.0","nodes":{"1":{"id":1,"data":{"bounds":"{\"_southWest\":{\"lat\":59.9339,\"lng\":30.2839},\"_northEast\":{\"lat\":59.9479,\"lng\":30.3155}}"},"inputs":{},"outputs":{"osm":{"connections":[{"node":3,"input":"osm","data":{}}]}},"position":[10,200],"name":"OSMInput"},"2":{"id":2,"data":{},"inputs":{"osm":{"connections":[{"node":3,"output":"osm","data":{}}]}},"outputs":{},"position":[600,200],"name":"Result"},"3":{"id":3,"data":{"tag_name":"leisure","tag_value":"park"},"inputs":{"osm":{"connections":[{"node":1,"output":"osm","data":{}}]}},"outputs":{"osm":{"connections":[{"node":2,"input":"osm","data":{}}]}},"position":[300,200],"name":"Filter_by_Tag"}}}}},"required":true},"responses":{"default":{"description":"Response for invalid graph with a missing connection between two nodes","content":{"application/json":{"example":"{\n  \"objects\": [\n    {\n      \"nodeType\": \"tag_filter\",\n      \"severity\": \"ERROR\",\n      \"key\": \"graph_validation.not_enough_inputs\",\n      \"localizedMessage\": \"Не заданы все входы узла\"\n    }\n  ],\n  \"code\": 0,\n  \"message\": \"Completed Successfully\",\n}"}}}},"security":[{"api-key":[]}]}},"/api/v1/pipeline/resultStatus":{"get":{"tags":["Pipeline"],"summary":"Get execution result status","description":"Retrieves pipeline execution status as a string. Status can be one of following: RUNNING, COMPLETED or ERROR","operationId":"getStatus","parameters":[{"name":"resultId","in":"query","description":"ID of execution result","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"default":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StringResponse"},"example":{"code":0,"message":"Completed successfuuly","result":"RUNNING","ok":true}}}}},"security":[{"api-key":[]}]}},"/api/v1/pipeline/run":{"post":{"tags":["Pipeline"],"summary":"Run Pipeline","description":"Schedules pipeline for execution. Returns id of execution result, which can be used later to check execution status and download result.","operationId":"runPipeline","parameters":[{"name":"pipelineId","in":"query","description":"Pipeline ID","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"default":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdResponse"},"example":{"code":0,"message":"Completed successfuuly","id":25,"ok":true}}}}},"security":[{"api-key":[]}]}},"/api/v1/pipeline/download":{"get":{"tags":["Pipeline"],"summary":"Download pipeline results","description":"Downloads pipeline execution result in a requested format. Returns a binary stream with result file.","operationId":"downloadResult","parameters":[{"name":"resultId","in":"query","description":"ID of execution result","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"format","in":"query","description":"Download format","required":false,"schema":{"type":"string","default":"geojson","enum":["geojson"]}}],"responses":{"200":{"description":"default response"}},"security":[{"api-key":[]}]}},"/api/v1/pipeline/getResults":{"get":{"tags":["Pipeline"],"summary":"List pipeline results","description":"Gets all execution results for a given pipeline","operationId":"getResults","parameters":[{"name":"pipelineId","in":"query","description":"ID of a pipeline","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"default":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StringResponse"},"example":{"objects":[{"id":444,"timestamp":1586866490039,"status":"COMPLETED"}],"code":0,"message":"Completed Successfully","ok":true}}}}},"security":[{"api-key":[]}]}},"/api/v1/status/ping":{"get":{"tags":["Status"],"summary":"Ping request","description":"Simple request to check if service is online. Always returns successful result","operationId":"ping","responses":{"200":{"description":"default response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BaseResponse"}}}}},"security":[{"api-key":[]}]}}},"components":{"schemas":{"ReteConnection":{"required":["data","node"],"type":"object","properties":{"node":{"type":"integer","format":"int32"},"input":{"type":"string"},"output":{"type":"string"},"data":{"type":"object","additionalProperties":{"type":"object"}}}},"ReteGraph":{"required":["id","nodes"],"type":"object","properties":{"id":{"type":"string"},"nodes":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReteNode"}}}},"ReteNode":{"required":["data","id","inputs","name","outputs","position"],"type":"object","properties":{"id":{"type":"integer","format":"int32"},"data":{"type":"object","additionalProperties":{"type":"object"}},"name":{"type":"string"},"inputs":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReteSocket"}},"outputs":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ReteSocket"}},"position":{"type":"array","items":{"type":"integer","format":"int32"}}}},"ReteSocket":{"required":["connections"],"type":"object","properties":{"connections":{"type":"array","items":{"$ref":"#/components/schemas/ReteConnection"}}}},"StringResponse":{"required":["code","message","ok"],"type":"object","properties":{"result":{"type":"string"},"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"ok":{"type":"boolean"}}},"IdResponse":{"required":["code","id","message","ok"],"type":"object","properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"ok":{"type":"boolean"}}},"BaseResponse":{"required":["code","message","ok"],"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"},"ok":{"type":"boolean"}}}},"securitySchemes":{"api-key":{"type":"apiKey","name":"AuthToken","in":"header"}}}}