Skip to content

Type overrides? #75

@halostatue

Description

@halostatue

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions