testapi/api.json

399 lines
15 KiB
JSON

{
"openapi": "3.1.0",
"info": {
"title": "API Testplatform",
"version": "0.0.1",
"description": "Mimicing the SmartDok api made by Visma"
},
"servers": [
{
"url": "http://localhost/api"
}
],
"security": [
{
"http": []
}
],
"paths": {
"/Departments": {
"get": {
"operationId": "department.index",
"summary": "GET /Departments\nQuery params:\n - departmentName (string)\n - updatedSince (date-time)",
"tags": [
"Department"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
},
"/Departments/{id}": {
"get": {
"operationId": "department.show",
"summary": "GET /Departments/{id}",
"tags": [
"Department"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Id": {
"type": "string"
},
"Name": {
"type": "string"
},
"Updated": {
"type": "string"
}
},
"required": [
"Id",
"Name",
"Updated"
]
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
},
"/Projects": {
"get": {
"operationId": "project.index",
"summary": "GET /Projects\nQuery params:\n - projectNumber (string)\n - projectName (string)\n - updatedSince (date-time)\n - createdSince (date-time)",
"tags": [
"Project"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
},
"/Projects/{id}": {
"get": {
"operationId": "project.show",
"summary": "GET /Projects/{id}",
"tags": [
"Project"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Id": {
"type": "string"
},
"ProjectName": {
"type": "string"
},
"ProjectNumber": {
"type": "string"
},
"Departments": {
"type": "string"
},
"UserIds": {
"type": "string"
},
"Updated": {
"type": "string"
},
"Created": {
"type": "string"
}
},
"required": [
"Id",
"ProjectName",
"ProjectNumber",
"Departments",
"UserIds",
"Updated",
"Created"
]
}
}
}
},
"404": {
"$ref": "#/components/responses/ModelNotFoundException"
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
},
"/Users": {
"get": {
"operationId": "smartdokProfile.index",
"description": "Returns a JSON array of all the smartdok users registered on the system\n\nExample response:\n{\n [\n \"Id\": \"00000000-0000-0000-0000-000000000000\",\n \"UserName\": \"string\",\n \"Name\": \"string\"\n ]\n}",
"summary": "List all users",
"tags": [
"SmartdokProfile"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
},
"/Users/{id}": {
"get": {
"operationId": "smartdokProfile.show",
"description": "Returns a JSON array of all the smartdok users registered on the system",
"summary": "Get a user",
"tags": [
"SmartdokProfile"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"Id": {
"type": "string"
},
"UserName": {
"type": "string"
},
"Name": {
"type": "string"
}
},
"required": [
"Id",
"UserName",
"Name"
]
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
},
"/WorkHours": {
"get": {
"operationId": "workHour.index",
"description": "Required query params:\n - fromDate : date-time (filters work_date >= fromDate)\n - toDate : date-time (filters work_date <= toDate)\nOptional query param:\n - projectId : integer (filters by associated project)",
"summary": "GET /WorkHours",
"tags": [
"WorkHour"
],
"parameters": [
{
"name": "fromDate",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "toDate",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "projectId",
"in": "query",
"schema": {
"type": [
"integer",
"null"
]
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"422": {
"$ref": "#/components/responses/ValidationException"
},
"401": {
"$ref": "#/components/responses/AuthenticationException"
}
}
}
}
},
"components": {
"securitySchemes": {
"http": {
"type": "http",
"scheme": "bearer"
}
},
"responses": {
"AuthenticationException": {
"description": "Unauthenticated",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error overview."
}
},
"required": [
"message"
]
}
}
}
},
"ModelNotFoundException": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Error overview."
}
},
"required": [
"message"
]
}
}
}
},
"ValidationException": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "Errors overview."
},
"errors": {
"type": "object",
"description": "A detailed description of each field that failed validation.",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"required": [
"message",
"errors"
]
}
}
}
}
}
}
}