Skip to content

Commit 70de65c

Browse files
committed
fix(golang): correct endpoints.yaml to generate DTO with a type that matches input type
The error was: NamedExec failed: Error 1366: Incorrect integer value: '' for column 'created_by' at row 1 Relate to #9 Relate to #13
1 parent 571e912 commit 70de65c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

examples/go/chi/mysql/routes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type CreateCategoryDto struct {
2424
Name *string `json:"name" db:"name"`
2525
NameRu *string `json:"name_ru" db:"name_ru"`
2626
Slug *string `json:"slug" db:"slug"`
27-
UserId *string `json:"user_id" db:"user_id"`
27+
UserId *int `json:"user_id" db:"user_id"`
2828
}
2929

3030
type CategoryInfoDto struct {

examples/js/express/mysql/endpoints.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
)
6868
dto:
6969
name: CreateCategoryDto
70+
fields:
71+
user_id:
72+
type: integer
7073

7174
- path: /v1/categories/:categoryId
7275
get:
@@ -91,6 +94,10 @@
9194
, updated_at = NOW()
9295
, updated_by = :b.user_id
9396
WHERE id = :p.categoryId
97+
dto:
98+
fields:
99+
user_id:
100+
type: integer
94101
delete:
95102
query: >-
96103
DELETE

0 commit comments

Comments
 (0)