mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-07-31 14:33:51 -04:00
Improve swagger def
This commit is contained in:
parent
411b50178e
commit
a0bb9a069c
@ -492,18 +492,19 @@ def create_app(args):
|
|||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
def langs():
|
def langs():
|
||||||
"""
|
"""
|
||||||
Retrieve list of supported languages
|
Get Supported Languages
|
||||||
---
|
---
|
||||||
tags:
|
tags:
|
||||||
- translate
|
- translate
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: List of languages
|
description: List of supported languages
|
||||||
schema:
|
schema:
|
||||||
id: languages
|
id: languages
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
|
description: Supported language
|
||||||
properties:
|
properties:
|
||||||
code:
|
code:
|
||||||
type: string
|
type: string
|
||||||
@ -539,7 +540,7 @@ def create_app(args):
|
|||||||
@access_check
|
@access_check
|
||||||
def translate():
|
def translate():
|
||||||
"""
|
"""
|
||||||
Translate text from a language to another
|
Translate Text
|
||||||
---
|
---
|
||||||
tags:
|
tags:
|
||||||
- translate
|
- translate
|
||||||
@ -560,7 +561,7 @@ def create_app(args):
|
|||||||
type: string
|
type: string
|
||||||
example: en
|
example: en
|
||||||
required: true
|
required: true
|
||||||
description: Source language code
|
description: Source language code or "auto" for auto detection
|
||||||
- in: formData
|
- in: formData
|
||||||
name: target
|
name: target
|
||||||
schema:
|
schema:
|
||||||
@ -795,7 +796,7 @@ def create_app(args):
|
|||||||
@access_check
|
@access_check
|
||||||
def translate_file():
|
def translate_file():
|
||||||
"""
|
"""
|
||||||
Translate file from a language to another
|
Translate a File
|
||||||
---
|
---
|
||||||
tags:
|
tags:
|
||||||
- translate
|
- translate
|
||||||
@ -813,7 +814,7 @@ def create_app(args):
|
|||||||
type: string
|
type: string
|
||||||
example: en
|
example: en
|
||||||
required: true
|
required: true
|
||||||
description: Source language code
|
description: Source language code or "auto" for auto detection
|
||||||
- in: formData
|
- in: formData
|
||||||
name: target
|
name: target
|
||||||
schema:
|
schema:
|
||||||
@ -1240,6 +1241,8 @@ def create_app(args):
|
|||||||
swag = swagger(app)
|
swag = swagger(app)
|
||||||
swag["info"]["version"] = get_version()
|
swag["info"]["version"] = get_version()
|
||||||
swag["info"]["title"] = "LibreTranslate"
|
swag["info"]["title"] = "LibreTranslate"
|
||||||
|
swag["info"]["description"] = "Free and Open Source Machine Translation API."
|
||||||
|
swag["info"]["license"] = {"name": "AGPL-3.0"}
|
||||||
|
|
||||||
@app.route(api_url)
|
@app.route(api_url)
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user