Skip to content

UPPER-cased acronyms in JSON tags #288

Open
@zibi94

Description

@zibi94

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions