Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code gen should avoid using *string in generated API spec #417

Open
2 tasks done
TimShi opened this issue May 31, 2024 · 0 comments
Open
2 tasks done

code gen should avoid using *string in generated API spec #417

TimShi opened this issue May 31, 2024 · 0 comments

Comments

@TimShi
Copy link
Contributor

TimShi commented May 31, 2024

Description

code gen should avoid using *string in generated API spec. This makes it inconvenient to use the string value.

Expected Behavior

expected generated code to use string

type RequestItem struct {
	FirstName string `json:"firstName" binding:"required,max=128"`
	LastName  string `json:"lastName" binding:"required,max=128"`
}

Actual Behavior

type RequestItem struct {
	FirstName *string `json:"firstName" binding:"required,max=128"`
	LastName  *string `json:"lastName" binding:"required,max=128"`
}

Affected Version

v0.14.0

Steps to Reproduce

Follow the README in examples/database to generate code based on contract.

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant