Skip to content

Commit

Permalink
fix(golang): correct endpoints.yaml to generate DTO with a type that …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
php-coder committed Mar 28, 2024
1 parent 571e912 commit 70de65c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/go/chi/mysql/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type CreateCategoryDto struct {
Name *string `json:"name" db:"name"`
NameRu *string `json:"name_ru" db:"name_ru"`
Slug *string `json:"slug" db:"slug"`
UserId *string `json:"user_id" db:"user_id"`
UserId *int `json:"user_id" db:"user_id"`
}

type CategoryInfoDto struct {
Expand Down
7 changes: 7 additions & 0 deletions examples/js/express/mysql/endpoints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
)
dto:
name: CreateCategoryDto
fields:
user_id:
type: integer

- path: /v1/categories/:categoryId
get:
Expand All @@ -91,6 +94,10 @@
, updated_at = NOW()
, updated_by = :b.user_id
WHERE id = :p.categoryId
dto:
fields:
user_id:
type: integer
delete:
query: >-
DELETE
Expand Down

0 comments on commit 70de65c

Please sign in to comment.