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

how to set generate example filed name use json tag #1708

Open
ttktatakai opened this issue Nov 22, 2023 · 1 comment
Open

how to set generate example filed name use json tag #1708

ttktatakai opened this issue Nov 22, 2023 · 1 comment

Comments

@ttktatakai
Copy link

for example I have a struct as input parameter

type Account struct {
  AccountType int `json:"account_type"`
}

Then I start swagger by using https://github.com/swaggo/gin-swagger.
The paramters example value shows as

{
  "accountType": "string"
}

I expected the field name is used json tag like

{
  "account_type": "string"
}

Is there anyway to config this?
Thanks in advance.

@rickywei
Copy link

You could use option -p snakecase

--propertyStrategy value, -p value Property Naming Strategy like snakecase,camelcase,pascalcase (default: "camelcase")

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

2 participants