107 lines
2.5 KiB
TypeScript
107 lines
2.5 KiB
TypeScript
|
|
export const templateSwaggerDocs = {
|
||
|
|
"/api/template": {
|
||
|
|
post: {
|
||
|
|
tags: ["template"],
|
||
|
|
summary: "Create new template",
|
||
|
|
description: "",
|
||
|
|
requestBody: {
|
||
|
|
required: true,
|
||
|
|
content: {
|
||
|
|
"application/json": {
|
||
|
|
example: JSON.stringify({}), // put your request body
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
responses: {
|
||
|
|
201: { description: "template created successfully" },
|
||
|
|
500: { description: "Validation error or internal server error" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
get: {
|
||
|
|
tags: ["template"],
|
||
|
|
summary: "Get all template",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "page",
|
||
|
|
in: "query",
|
||
|
|
required: false,
|
||
|
|
schema: { type: "number" },
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: "limit",
|
||
|
|
in: "query",
|
||
|
|
required: false,
|
||
|
|
schema: { type: "number" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
responses: {
|
||
|
|
200: { description: "template fetched successfully" },
|
||
|
|
401: { description: "unauthorized" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
|
||
|
|
"/api/template/{id}": {
|
||
|
|
get: {
|
||
|
|
tags: ["template"],
|
||
|
|
summary: "Get single template",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "id",
|
||
|
|
in: "path",
|
||
|
|
required: true,
|
||
|
|
schema: { type: "string" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
responses: {
|
||
|
|
200: { description: "template fetched successfully" },
|
||
|
|
401: { description: "unauthorized" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
patch: {
|
||
|
|
tags: ["template"],
|
||
|
|
summary: "Update template",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "id",
|
||
|
|
in: "path",
|
||
|
|
required: true,
|
||
|
|
schema: { type: "string" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
requestBody: {
|
||
|
|
required: true,
|
||
|
|
content: {
|
||
|
|
"application/json": {
|
||
|
|
example: JSON.stringify({}), // put your request body
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
responses: {
|
||
|
|
200: { description: "template updated successfully" },
|
||
|
|
500: { description: "Validation error or internal server error" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
delete: {
|
||
|
|
tags: ["template"],
|
||
|
|
summary: "Delete template",
|
||
|
|
description: "",
|
||
|
|
parameters: [
|
||
|
|
{
|
||
|
|
name: "id",
|
||
|
|
in: "path",
|
||
|
|
required: true,
|
||
|
|
schema: { type: "string" },
|
||
|
|
},
|
||
|
|
],
|
||
|
|
responses: {
|
||
|
|
200: { description: "template delete successfully" },
|
||
|
|
401: { description: "unauthorized" },
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|