{ "swagger": "2.0", "info": { "title": "API Árvore genealógica", "contact": { "name": "Pedro Yoshimura", "email": "ropehapi@gmail.com" }, "version": "1.0" }, "host": "localhost:8080", "basePath": "/", "paths": { "/person": { "get": { "description": "List person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "persons" ], "summary": "List person", "responses": { "200": { "description": "OK" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } }, "post": { "description": "Create person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "persons" ], "summary": "Create person", "parameters": [ { "description": "person request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/usecase.CreateUpdatePersonUsecaseInputDTO" } } ], "responses": { "201": { "description": "Created" }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } } }, "/person/{id}": { "get": { "description": "Get person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "persons" ], "summary": "Get person", "parameters": [ { "type": "string", "format": "uuid", "description": "product ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } }, "put": { "description": "Update person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "persons" ], "summary": "Update person", "parameters": [ { "type": "string", "format": "uuid", "description": "product ID", "name": "id", "in": "path", "required": true }, { "description": "person request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/usecase.CreateUpdatePersonUsecaseInputDTO" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } }, "delete": { "description": "Delete person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "persons" ], "summary": "Delete person", "parameters": [ { "type": "string", "format": "uuid", "description": "product ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } } }, "/relationship": { "post": { "description": "Create relationship", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "relationship" ], "summary": "Create relationship", "parameters": [ { "description": "relationship request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/usecase.CreateRelationshipInputDTO" } } ], "responses": { "201": { "description": "Created" }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } }, "delete": { "description": "Delete relationship", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "relationship" ], "summary": "Delete relationship", "parameters": [ { "description": "relationship request", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/usecase.DeleteRelationshipUsecaseInputDTO" } } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } } }, "/relationship/{id}/asc": { "get": { "description": "GetRelationshipsDescendant person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "relationship" ], "summary": "GetRelationshipsDescendant person", "parameters": [ { "type": "string", "format": "uuid", "description": "relationship ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } } }, "/relationship/{id}/desc": { "get": { "description": "GetRelationshipsDescendant person", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "relationship" ], "summary": "GetRelationshipsDescendant person", "parameters": [ { "type": "string", "format": "uuid", "description": "relationship ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "Bad Request" }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/web.Error" } } } } } }, "definitions": { "usecase.CreateRelationshipInputDTO": { "type": "object", "properties": { "childrenId": { "type": "string" }, "parentId": { "type": "string" } } }, "usecase.CreateUpdatePersonUsecaseInputDTO": { "type": "object", "properties": { "name": { "type": "string" } } }, "usecase.DeleteRelationshipUsecaseInputDTO": { "type": "object", "properties": { "childrenId": { "type": "string" }, "parentId": { "type": "string" } } }, "web.Error": { "type": "object", "properties": { "message": { "type": "string" } } } } }