-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from Stivo182/feat/api
feat(api): Добавление swagger
- Loading branch information
Showing
8 changed files
with
197 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>API</title> | ||
|
||
<!-- favicon --> | ||
<link rel="apple-touch-icon" sizes="57x57" href="/images/favicons/apple-icon-57x57.png"> | ||
<link rel="apple-touch-icon" sizes="60x60" href="/images/favicons/apple-icon-60x60.png"> | ||
<link rel="apple-touch-icon" sizes="72x72" href="/images/favicons/apple-icon-72x72.png"> | ||
<link rel="apple-touch-icon" sizes="76x76" href="/images/favicons/apple-icon-76x76.png"> | ||
<link rel="apple-touch-icon" sizes="114x114" href="/images/favicons/apple-icon-114x114.png"> | ||
<link rel="apple-touch-icon" sizes="120x120" href="/images/favicons/apple-icon-120x120.png"> | ||
<link rel="apple-touch-icon" sizes="144x144" href="/images/favicons/apple-icon-144x144.png"> | ||
<link rel="apple-touch-icon" sizes="152x152" href="/images/favicons/apple-icon-152x152.png"> | ||
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicons/apple-icon-180x180.png"> | ||
<link rel="icon" type="image/png" sizes="192x192" href="/images/favicons/android-icon-192x192.png"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicons/favicon-32x32.png"> | ||
<link rel="icon" type="image/png" sizes="96x96" href="/images/favicons/favicon-96x96.png"> | ||
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicons/favicon-16x16.png"> | ||
<link rel="manifest" href="/images/favicons/manifest.json"> | ||
<meta name="msapplication-TileColor" content="#ffffff"> | ||
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png"> | ||
<meta name="theme-color" content="#ffffff"> | ||
<!-- /favicon --> | ||
|
||
<link rel="stylesheet" type="text/css" href="/static/swagger/swagger-ui.css" /> | ||
<link rel="stylesheet" type="text/css" href="/static/swagger/index.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="/static/swagger/swagger-ui-bundle.js" charset="UTF-8"></script> | ||
<script src="/static/swagger/swagger-ui-standalone-preset.js" charset="UTF-8"></script> | ||
<script> | ||
window.onload = function() { | ||
window.ui = SwaggerUIBundle({ | ||
url: "/static/openapi.json", | ||
dom_id: '#swagger-ui', | ||
deepLinking: true, | ||
docExpansion: 'full', | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIStandalonePreset | ||
], | ||
presets_config: { | ||
SwaggerUIStandalonePreset: { | ||
TopbarPlugin: false | ||
} | ||
}, | ||
plugins: [ | ||
SwaggerUIBundle.plugins.DownloadUrl | ||
], | ||
layout: "StandaloneLayout" | ||
}); | ||
}; | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "curlone", | ||
"description": "Конвертер команды curl в код на языке 1С", | ||
"version": "1.0.0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "/api/v1" | ||
} | ||
], | ||
"paths": { | ||
"/convert": { | ||
"get": { | ||
"tags": [ | ||
"API" | ||
], | ||
"summary": "Конвертирует команду curl в код на 1С", | ||
"parameters": [ | ||
{ | ||
"name": "cmd", | ||
"in": "query", | ||
"description": "Команда curl", | ||
"required": true, | ||
"explode": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "lang", | ||
"in": "query", | ||
"description": "Язык", | ||
"required": false, | ||
"explode": true, | ||
"schema": { | ||
"type": "string", | ||
"default": "1c", | ||
"enum": [ | ||
"1c", | ||
"connector" | ||
] | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful operation", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Result" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Result": { | ||
"description": "Результат конвертации", | ||
"type": "object", | ||
"properties": { | ||
"result": { | ||
"description": "Код на 1С", | ||
"type": "string" | ||
}, | ||
"errors": { | ||
"description": "Ошибки и предупреждения", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
}, | ||
"Error": { | ||
"description": "Описание ошибки", | ||
"type": "object", | ||
"properties": { | ||
"text": { | ||
"description": "Текст ошибки", | ||
"type": "string" | ||
}, | ||
"critical": { | ||
"description": "Ошибка критичная", | ||
"type": "boolean" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
html { | ||
box-sizing: border-box; | ||
overflow: -moz-scrollbars-vertical; | ||
overflow-y: scroll; | ||
} | ||
|
||
*, | ||
*:before, | ||
*:after { | ||
box-sizing: inherit; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
background: #fafafa; | ||
} | ||
|
||
.swagger-ui .topbar { | ||
display: none !important; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
src/interface/view/static/swagger/swagger-ui-standalone-preset.js
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters