From aad4b8307958fe26cf367af865db53ffcb6c85d5 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Sat, 20 Jul 2024 15:38:23 +0530 Subject: [PATCH] how did i forget to comment my testing stuff --- docs/docs.go | 61 ++++++++++++++++++++++++++++++++++++++++++----- docs/swagger.json | 61 ++++++++++++++++++++++++++++++++++++++++++----- docs/swagger.yaml | 46 ++++++++++++++++++++++++++++++----- go.mod | 2 +- 4 files changed, 151 insertions(+), 19 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 41409cc..2efd224 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -41,28 +41,28 @@ const docTemplate = `{ "type": "string", "description": "Engine name", "name": "engine", - "in": "query", + "in": "formData", "required": true }, { "type": "string", "description": "Source language", "name": "from", - "in": "query", + "in": "formData", "required": true }, { "type": "string", "description": "Target language", "name": "to", - "in": "query", + "in": "formData", "required": true }, { - "type": "string", - "description": "PNG image in base64 format", + "type": "file", + "description": "PNG image", "name": "image", - "in": "query", + "in": "formData", "required": true } ], @@ -227,15 +227,57 @@ const docTemplate = `{ "engine": { "type": "string" }, + "source_antonyms": { + "type": "array", + "items": { + "type": "string" + } + }, + "source_equivalent_target_lang": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, "source_language": { "type": "string" }, + "source_synonyms": { + "type": "array", + "items": { + "type": "string" + } + }, "source_transliteration": { "type": "string" }, + "target_antonyms": { + "type": "array", + "items": { + "type": "string" + } + }, + "target_equivalent_source_lang": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, "target_language": { "type": "string" }, + "target_synonyms": { + "type": "array", + "items": { + "type": "string" + } + }, "target_transliteration": { "type": "string" }, @@ -264,6 +306,13 @@ const docTemplate = `{ "libmozhi.WordChoices": { "type": "object", "properties": { + "definition": { + "type": "string" + }, + "example": { + "description": "Example is for google alone; since it does not have a linked example for source \u0026 target", + "type": "string" + }, "examples_source": { "type": "array", "items": { diff --git a/docs/swagger.json b/docs/swagger.json index b7fc1ed..7e17113 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -30,28 +30,28 @@ "type": "string", "description": "Engine name", "name": "engine", - "in": "query", + "in": "formData", "required": true }, { "type": "string", "description": "Source language", "name": "from", - "in": "query", + "in": "formData", "required": true }, { "type": "string", "description": "Target language", "name": "to", - "in": "query", + "in": "formData", "required": true }, { - "type": "string", - "description": "PNG image in base64 format", + "type": "file", + "description": "PNG image", "name": "image", - "in": "query", + "in": "formData", "required": true } ], @@ -216,15 +216,57 @@ "engine": { "type": "string" }, + "source_antonyms": { + "type": "array", + "items": { + "type": "string" + } + }, + "source_equivalent_target_lang": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, "source_language": { "type": "string" }, + "source_synonyms": { + "type": "array", + "items": { + "type": "string" + } + }, "source_transliteration": { "type": "string" }, + "target_antonyms": { + "type": "array", + "items": { + "type": "string" + } + }, + "target_equivalent_source_lang": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "string" + } + } + }, "target_language": { "type": "string" }, + "target_synonyms": { + "type": "array", + "items": { + "type": "string" + } + }, "target_transliteration": { "type": "string" }, @@ -253,6 +295,13 @@ "libmozhi.WordChoices": { "type": "object", "properties": { + "definition": { + "type": "string" + }, + "example": { + "description": "Example is for google alone; since it does not have a linked example for source \u0026 target", + "type": "string" + }, "examples_source": { "type": "array", "items": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index f1a95d3..1eebcc2 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -20,12 +20,40 @@ definitions: 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: @@ -44,6 +72,12 @@ definitions: 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 @@ -74,25 +108,25 @@ paths: description: When engine is set to all, it will return an array of libmozhi.LangOut. parameters: - description: Engine name - in: query + in: formData name: engine required: true type: string - description: Source language - in: query + in: formData name: from required: true type: string - description: Target language - in: query + in: formData name: to required: true type: string - - description: PNG image in base64 format - in: query + - description: PNG image + in: formData name: image required: true - type: string + type: file responses: "200": description: OK diff --git a/go.mod b/go.mod index a86c884..ce57dd5 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.0 replace github.com/OwO-Network/gdeeplx => github.com/gi-yt/gdeeplx v0.0.0-20230817133036-0eb71706cd51 -replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi +//replace codeberg.org/aryak/libmozhi => /home/arya/projects/mozhi/libmozhi require ( codeberg.org/aryak/libmozhi v0.0.0-20240717101951-60801036fad6