36 lines
963 B
Plaintext
36 lines
963 B
Plaintext
{
|
|
"OpenAPI Hono Route": {
|
|
"prefix": "ohana",
|
|
"body": [
|
|
"import { OpenAPIHono, createRoute, z } from \"@hono/zod-openapi\";",
|
|
"import type { Env } from \"~/types/env\";",
|
|
"import { SuccessResponseSchema } from \"~/types/schema\";",
|
|
"const app = new OpenAPIHono<Env>();",
|
|
"",
|
|
"const $4Response = SuccessResponseSchema($5);",
|
|
"",
|
|
"const route = createRoute({",
|
|
" tags: [\"aniplay\", $9],",
|
|
" operationId: \"$1\",",
|
|
" summary: \"$6\",",
|
|
" description: \"$7\",",
|
|
" method: \"$2\",",
|
|
" path: \"${3:/}\",",
|
|
" request: {",
|
|
" },",
|
|
" responses: {",
|
|
" 200: {",
|
|
" content: {",
|
|
" \"application/json\": {",
|
|
" schema: ${5:$4Response},",
|
|
" },",
|
|
" },",
|
|
" description: \"$8\",",
|
|
" },",
|
|
" },",
|
|
"});",
|
|
],
|
|
"description": "OpenAPI Hono Route",
|
|
},
|
|
}
|