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

Go language generation for xsd:integer produces wrong code #10

Open
ooxi opened this issue Sep 8, 2020 · 0 comments
Open

Go language generation for xsd:integer produces wrong code #10

ooxi opened this issue Sep 8, 2020 · 0 comments

Comments

@ooxi
Copy link

ooxi commented Sep 8, 2020

Description

Generating a binding for an XML Schema containing xsd:integer will result in int. This is an error since xsd:integer is unbounded while the Go type int is a 32-bit signed integer

Steps to reproduce the issue:

  1. Create an XML schema containing an element of type xsd:integer (assuming xmlns:xsd="http://www.w3.org/2001/XMLSchema")
  2. Execute xgen -i myschema.xsd -o myoutput -l Go
  3. Look at the generated myoutput/myschema.xsd.go

Describe the results you received:

type MyType struct {
	Id         int    `xml:"id"`
}

Describe the results you expected:

type MyType struct {
	Id         Int    `xml:"id"`
}

I'm not a Go expert, but I would have expected a type which can represent arbitrary integer values. Maybe big.Int?

Output of go version:

go version go1.15.1 linux/arm

Aurora version or commit ID:

???

Sorry, I don't know aurora

Environment details (OS, physical, etc.):

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
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