Reformatting openapi

This commit is contained in:
Barry Wang 2024-04-15 12:13:41 -04:00
parent 734504dcf1
commit f89a41eee1
3 changed files with 30 additions and 120 deletions

View File

@ -1,7 +1,7 @@
{ {
"api": { "api": {
"type": "openapi", "type": "openapi",
"url": "https://raw.githubusercontent.com/GithuBarry/chat-plugin-search-engine/main/public/openapi_2.json", "url": "https://raw.githubusercontent.com/GithuBarry/chat-plugin-search-engine/main/public/openapi.json",
"is_user_authenticated": false "is_user_authenticated": false
}, },
"auth": { "auth": {

View File

@ -18,35 +18,35 @@
"post": { "post": {
"summary": "Search Google and return top 10 results", "summary": "Search Google and return top 10 results",
"operationId": "searchGoogle", "operationId": "searchGoogle",
"requestBody": { "parameters": [
"required": true, {
"content": { "in": "query",
"application/json": { "name": "q",
"schema": { "schema": {
"type": "object", "type": "string"
"required": [ },
"q" "required": true,
], "description": "Search query string"
"properties": { },
"q": { {
"type": "string", "in": "query",
"example": "今天吃什么" "name": "gl",
}, "schema": {
"gl": { "type": "string"
"type": "string", },
"description": "Google Geo location parameter", "required": false,
"example": "cn" "description": "Google Geo location parameter"
}, },
"hl": { {
"type": "string", "in": "query",
"description": "Google Geo locale parameter", "name": "hl",
"example": "zh-cn" "schema": {
} "type": "string"
} },
} "required": false,
} "description": "Google Geo locale parameter"
} }
}, ],
"responses": { "responses": {
"200": { "200": {
"description": "Successful search results", "description": "Successful search results",

View File

@ -1,90 +0,0 @@
{
"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"
}
]
}