From 734504dcf109658ae26ebaf0835187430cd4c5c3 Mon Sep 17 00:00:00 2001 From: Barry Wang <33831597+GithuBarry@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:11:20 -0400 Subject: [PATCH] reformatting openapi --- public/manifest.json | 2 +- public/openapi_2.json | 90 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 public/openapi_2.json diff --git a/public/manifest.json b/public/manifest.json index fea66a0..ea86154 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,7 +1,7 @@ { "api": { "type": "openapi", - "url": "https://raw.githubusercontent.com/GithuBarry/chat-plugin-search-engine/main/public/openapi.json", + "url": "https://raw.githubusercontent.com/GithuBarry/chat-plugin-search-engine/main/public/openapi_2.json", "is_user_authenticated": false }, "auth": { diff --git a/public/openapi_2.json b/public/openapi_2.json new file mode 100644 index 0000000..6926cb6 --- /dev/null +++ b/public/openapi_2.json @@ -0,0 +1,90 @@ +{ + "components": { + "securitySchemes": { + "apiAuth": { + "type": "apiKey", + "name": "X-API-KEY", + "in": "header" + } + } + }, + "info": { + "title": "Web Search", + "version": "1.0.0" + }, + "openapi": "3.0.0", + "paths": { + "/search": { + "post": { + "summary": "Search Google and return top 10 results", + "operationId": "searchGoogle", + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": true, + "description": "Search query string" + }, + { + "in": "query", + "name": "gl", + "schema": { + "type": "string" + }, + "required": false, + "description": "Google Geo location parameter" + }, + { + "in": "query", + "name": "hl", + "schema": { + "type": "string" + }, + "required": false, + "description": "Google Geo locale parameter" + } + ], + "responses": { + "200": { + "description": "Successful search results", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "result" + ], + "properties": { + "result": { + "type": "string", + "description": "Top 10 search results", + "example": "\"title\": \"周末游推荐\",\n\"link\": \"https://www.example.com/destinations-for-weekends\",\n\"snippet\": \"周末去哪玩?周末旅游频道,精心推荐数百个周末游经典线路\",\n\"position\": 1" + } + } + } + } + } + } + }, + "security": [ + { + "apiAuth": [] + } + ] + } + } + }, + "security": [ + { + "apiAuth": [] + } + ], + "servers": [ + { + "url": "https://google.serper.dev" + } + ] +} \ No newline at end of file