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

Snake case on json tags for relationship structs #313

Open
fseda opened this issue Nov 28, 2024 · 1 comment
Open

Snake case on json tags for relationship structs #313

fseda opened this issue Nov 28, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fseda
Copy link

fseda commented Nov 28, 2024

// File is an object representing the database table.
type File struct {
	ID           uuid.UUID           `db:"id,pk" json:"id"`
	SensorID     uuid.UUID           `db:"sensor_id" json:"sensor_id"`
        .
        .
        .
	R fileR `db:"-" json:"-"`
}


// fileR is where relationships are stored.
type fileR struct {
	Reading          *Reading    `json:"Reading"`          // files.files_reading_id_fkey
	Sensor           *Sensor     `json:"Sensor"`           // files.files_sensor_id_fkey
	StatusFileStatus *FileStatus `json:"StatusFileStatus"` // files.files_status_id_fkey
}

Is there a way to generate the json tags for relationships with snake case format? Currently they are being generated with Pascal case, the main structs are being generated correct with snake case.

@stephenafamo
Copy link
Owner

There is no way to configure this at the moment. This issue is also similar to #288

@stephenafamo stephenafamo added enhancement New feature or request help wanted Extra attention is needed labels Nov 28, 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