Pascal Gloor 5 роки тому
джерело
коміт
86ebf66337
1 змінених файлів з 429 додано та 0 видалено
  1. 429
    0
      openapi.json

+ 429
- 0
openapi.json Переглянути файл

@@ -0,0 +1,429 @@
{
"openapi": "3.0.2",
"info": {
"title": "AutoDoc API",
"description": "API description of AutoDoc",
"version": "1.0"
},
"servers": [
{
"url": "https://autodoc.home.spale.com/v1",
"description": "Gloor AutoDoc Server"
}
],
"tags": [
{
"name": "Create",
"description": "Create new documents/pages"
},
{
"name": "Upload",
"description": "Upload new documents"
},
{
"name": "Images",
"description": "Get documents/pages images/thumbnails"
},
{
"name": "Tags",
"description": "Manipulate tags"
}
],
"components": {
"schemas": {
"page": {
"description": "page object",
"type": "object",
"properties": {
"id": {
"readOnly": true,
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
},
"documentId": {
"readOnly": true,
"description": "Link to Document",
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
},
"name": {
"readOnly": false,
"description": "Document name, may be empty",
"type": "string"
},
"created": {
"readOnly": true,
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
},
"owner": {
"readOnly": true,
"description": "Username of document owner",
"type": "string"
},
"status": {
"readOnly": true,
"description": "Status of document",
"type": "string",
"enum": [
"nodata",
"inprogress",
"deleted",
"ok"
]
},
"languages": {
"readOnly": true,
"description": "Languages in document in order of importance",
"type": "array",
"items": {
"type": "string",
"enum": [
"en",
"de",
"it",
"fr"
]
}
}
}
},
"document": {
"description": "Document object",
"type": "object",
"properties": {
"id": {
"readOnly": true,
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
},
"pageId": {
"readOnly": true,
"description": "Link to PageIds",
"type": "array",
"items": {
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
}
},
"name": {
"readOnly": false,
"description": "Document name, may be empty",
"type": "string"
},
"created": {
"readOnly": true,
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
},
"owner": {
"readOnly": true,
"description": "Username of document owner",
"type": "string"
},
"status": {
"readOnly": true,
"description": "Status of document",
"type": "string",
"enum": [
"nodata",
"inprogress",
"deleted",
"ok"
]
},
"languages": {
"readOnly": true,
"description": "Languages in document in order of importance",
"type": "array",
"items": {
"type": "string",
"enum": [
"en",
"de",
"it",
"fr"
]
}
}
}
}
},
"parameters": {},
"securitySchemes": {
"basicAuth": {
"type": "http",
"scheme": "basic"
}
}
},
"security": [
{
"basicAuth": []
}
],
"paths": {
"/documents": {
"post": {
"summary": "Create a new document",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/document"
}
}
}
}
}
},
"get": {
"summary": "Returns a list of documents",
"parameters": [
{
"in": "query",
"name": "pageSize",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 1000,
"default": 50
}
},
{
"in": "query",
"name": "pageIndex",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 65535,
"default": 0
}
},
{
"in": "query",
"name": "filterLanguage",
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"fr",
"de",
"it",
"en"
]
}
}
},
{
"in": "query",
"name": "filterKeyword",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"in": "query",
"name": "filterTag",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/document"
}
}
}
}
}
}
}
},
"/documents/{documentId}": {
"get": {
"summary": "retrieve a document meta data",
"parameters": [
{
"in": "path",
"name": "documentId",
"required": true,
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/document"
}
}
}
},
"404": {
"description": "Document not found"
}
}
}
},
"/documents/{documentId}/image": {
"get": {
"summary": "Get an image or thumbnail of the document",
"parameters": [
{
"in": "query",
"name": "maxWidth",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 10000
}
},
{
"in": "query",
"name": "maxHeight",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 10000
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"image/*": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
},
"/documents/{documentId}/data": {
"post": {
"summary": "Add one (or multiple if PDF) page to the document",
"requestBody": {
"content": {
"image/*": {
"schema": {
"type": "string",
"format": "binary"
}
},
"application/pdf": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/pages/{pageId}": {
"get": {
"summary": "Get page properties",
"parameters": [
{
"in": "path",
"name": "pageId",
"required": true,
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/page"
}
}
}
}
}
}
},
"/pages/{pageId}/image": {
"get": {
"summary": "get an image or thumbnail of the page",
"parameters": [
{
"in": "query",
"name": "maxWidth",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 10000
}
},
{
"in": "query",
"name": "maxHeight",
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 10000
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"image/*": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
}
}
}
}
}
}

Завантаження…
Відмінити
Зберегти