mozhi/docs/swagger.yaml
2024-07-20 15:38:23 +05:30

214 lines
4.9 KiB
YAML

definitions:
libmozhi.ImgOut:
properties:
sourceB64:
type: string
sourceLang:
type: string
sourceTextParsed:
type: string
targetLang:
type: string
translatedImgB64:
type: string
translatedTextParsed:
type: string
type: object
libmozhi.LangOut:
properties:
detected:
type: string
engine:
type: string
source_antonyms:
items:
type: string
type: array
source_equivalent_target_lang:
additionalProperties:
items:
type: string
type: array
type: object
source_language:
type: string
source_synonyms:
items:
type: string
type: array
source_transliteration:
type: string
target_antonyms:
items:
type: string
type: array
target_equivalent_source_lang:
additionalProperties:
items:
type: string
type: array
type: object
target_language:
type: string
target_synonyms:
items:
type: string
type: array
target_transliteration:
type: string
translated-text:
type: string
word_choices:
items:
$ref: '#/definitions/libmozhi.WordChoices'
type: array
type: object
libmozhi.List:
properties:
id:
type: string
name:
type: string
type: object
libmozhi.WordChoices:
properties:
definition:
type: string
example:
description: Example is for google alone; since it does not have a linked
example for source & target
type: string
examples_source:
items:
type: string
type: array
examples_target:
items:
type: string
type: array
word:
type: string
type: object
info:
contact: {}
paths:
/api/engines:
get:
description: Lists available Engines.
responses:
"200":
description: OK
schema:
additionalProperties:
type: string
type: object
summary: List engines
/api/image:
post:
description: When engine is set to all, it will return an array of libmozhi.LangOut.
parameters:
- description: Engine name
in: formData
name: engine
required: true
type: string
- description: Source language
in: formData
name: from
required: true
type: string
- description: Target language
in: formData
name: to
required: true
type: string
- description: PNG image
in: formData
name: image
required: true
type: file
responses:
"200":
description: OK
schema:
$ref: '#/definitions/libmozhi.ImgOut'
summary: Translate an image
/api/source_languages:
get:
parameters:
- description: Engine name
in: query
name: engine
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/libmozhi.List'
summary: Show list of available source languages for engine
/api/target_languages:
get:
parameters:
- description: Engine name
in: query
name: engine
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/libmozhi.List'
summary: Show list of available target languages for engine
/api/translate:
get:
description: When engine is set to all, it will return an array of libmozhi.LangOut.
parameters:
- description: Engine name
in: query
name: engine
required: true
type: string
- description: Source language
in: query
name: from
required: true
type: string
- description: Target language
in: query
name: to
required: true
type: string
- description: Text being translated
in: query
name: text
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/libmozhi.LangOut'
summary: Translate text
/api/tts:
get:
parameters:
- description: Engine name
in: query
name: engine
required: true
type: string
- description: Language being TTS'd
in: query
name: lang
required: true
type: string
- description: Text being TTS'd
in: query
name: text
required: true
type: string
responses: {}
summary: Get Text-To-Speech for specified language using specified engine
swagger: "2.0"