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

Type overrides? #75

Open
halostatue opened this issue Jun 21, 2024 · 0 comments
Open

Type overrides? #75

halostatue opened this issue Jun 21, 2024 · 0 comments

Comments

@halostatue
Copy link

Is your feature request related to a problem? Please describe.

The choice (in Go) to use float64 to represent xsd:decimal is an incorrect choice because decimal does not have the data loss issues associated with floating point numbers. It would be useful to be able to specify overrides for those types.

Describe the solution you'd like

$ xgen -i XSD -l Go -o PATH --type decimal=string
# the generated file uses `string` where `xsd:decimal` was present
$ xgen -i XSD -l Go -o PATH --type decimal=decimal --go-type-import decimal github.com/ericlagergren/decimal
# the generated file uses `decimal` where `xsd:decimal` was present and imports `github.com/ericlagergren/decimal`

Describe alternatives you've considered

Post-code generation modifications. These are primarily unsuitable because there are use cases where float64 would be used natively.

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