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

UPPER-cased acronyms in JSON tags #288

Open
zibi94 opened this issue Oct 25, 2024 · 1 comment
Open

UPPER-cased acronyms in JSON tags #288

zibi94 opened this issue Oct 25, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zibi94
Copy link

zibi94 commented Oct 25, 2024

Following JSON camelCase naming convention acronyms should be not uppercased.

  • test table definition:
CREATE TABLE acronyms (
    acronym_id SERIAL,
    acronym_http VARCHAR NOT NULL,
    acronym_url VARCHAR NOT NULL,
    acronym_dns VARCHAR NOT NULL
)
  • config file.
psql:
  output: "./sql/bob/models/acronym"
  pkgname: "acronym"
  schemas: ["public"]
no_factory: true
tags:
  - json
struct_tag_casing: "camel"
  • generated model
type Acronym struct {
	AcronymID   int32  `db:"acronym_id" json:"acronymID"`
	AcronymHTTP string `db:"acronym_http" json:"acronymHTTP"`
	AcronymURL  string `db:"acronym_url" json:"acronymURL"`
	AcronymDNS  string `db:"acronym_dns" json:"acronymDNS"`
}

Conclusion:
Acronyms in json tags should be not uppercased. Or there should be possibility to declare some property in config to choose acronym naming convention.

@stephenafamo stephenafamo added the question Further information is requested label Oct 25, 2024
@stephenafamo
Copy link
Owner

There is currently no configuration to support this.

While I want to improve this, it will likely not be prioritised soon. I'll add a help wanted tag in the meantime in case someone wants to take a look.

If you can send in a PR I'll be very happy to review it.

@stephenafamo stephenafamo added enhancement New feature or request help wanted Extra attention is needed and removed question Further information is requested labels Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants