Skip to content

Commit

Permalink
feat!: support string pointers (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov authored Jun 19, 2024
1 parent 5e3d41b commit 7c28de5
Show file tree
Hide file tree
Showing 34 changed files with 702 additions and 702 deletions.
2 changes: 1 addition & 1 deletion generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func exec() error {
// But for required scalars should be zero values
returnErr = jen.Return(jen.Nil(), jen.Err())

if rsp.required || rsp.Type == SchemaTypeString {
if rsp.required {
switch rsp.Type {
case SchemaTypeString:
returnErr = jen.Return(jen.Lit(""), jen.Err())
Expand Down
6 changes: 3 additions & 3 deletions generator/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ func getType(s *Schema) *jen.Statement {
return jen.Id(s.CamelName)
case s.isScalar():
scalar := getScalarType(s)
if !s.required && s.Type != SchemaTypeString {
return jen.Op("*").Add(scalar)
if s.required {
return scalar
}

return scalar
return jen.Op("*").Add(scalar)
}

switch {
Expand Down
56 changes: 28 additions & 28 deletions handler/account/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7c28de5

Please sign in to comment.