feat: first commit

This commit is contained in:
2025-07-25 01:40:34 +03:00
parent 791042057f
commit 96437cafb2
20 changed files with 1698 additions and 22 deletions

6
api/todo/cfg.yaml Normal file
View File

@ -0,0 +1,6 @@
package: handler
generate:
fiber-server: true
strict-server: true
models: true
output: gen.go

133
api/todo/todo.yaml Normal file
View File

@ -0,0 +1,133 @@
openapi: 3.0.0
info:
title: Todo CRUD API
version: 1.0.0
servers:
- url: https://api.example.com/v1
paths:
/todos:
get:
summary: Get all todos
responses:
'200':
description: A list of todos
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Todo'
post:
summary: Create a new todo
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TodoCreate'
responses:
'201':
description: Todo created
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
/todos/{todoId}:
get:
summary: Get a todo by ID
parameters:
- name: todoId
in: path
required: true
schema:
type: string
responses:
'200':
description: Todo details
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
'404':
description: Todo not found
put:
summary: Update a todo by ID
parameters:
- name: todoId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TodoUpdate'
responses:
'200':
description: Todo updated
content:
application/json:
schema:
$ref: '#/components/schemas/Todo'
'404':
description: Todo not found
delete:
summary: Delete a todo by ID
parameters:
- name: todoId
in: path
required: true
schema:
type: string
responses:
'204':
description: Todo deleted successfully
'404':
description: Todo not found
components:
schemas:
Todo:
type: object
properties:
id:
type: string
example: "1"
title:
type: string
example: "Buy groceries"
description:
type: string
example: "Milk, Bread, Eggs"
completed:
type: boolean
example: false
required:
- id
- title
- completed
TodoCreate:
type: object
properties:
title:
type: string
example: "Buy groceries"
description:
type: string
example: "Milk, Bread, Eggs"
required:
- title
TodoUpdate:
type: object
properties:
title:
type: string
example: "Buy more groceries"
description:
type: string
example: "Milk, Bread, Eggs, Cheese"
completed:
type: boolean
example: true