Git Product home page Git Product logo

Comments (8)

md5 avatar md5 commented on May 18, 2024

What about using big.Int for xsd:integer?

from gowsdl.

danielkwinsor avatar danielkwinsor commented on May 18, 2024

Yeah, that sounds even better than a string, and I'll give it a try when I get back to work in a few days.

from gowsdl.

danielkwinsor avatar danielkwinsor commented on May 18, 2024

type XyzTypee big.Int generates "invalid constant type" no matter whether 0 or "0"

from gowsdl.

md5 avatar md5 commented on May 18, 2024

@danielkwinsor Can you be more specific about what generates that error and what you did?

from gowsdl.

md5 avatar md5 commented on May 18, 2024

It looks like types_tmpl.go assumes that all restrictions are string enumerations currently.

from gowsdl.

danielkwinsor avatar danielkwinsor commented on May 18, 2024

Yeah sure so, originally I changed line 405 of gowsdl.go in the support-for-imports branch -- to "integer": "string",
This worked to compile, though I haven't tested the client yet.

Tried "integer": "big.Int", and hand-imported math/big, but did not change types_tmpl.go
This did not work because

myservice/myservice.go:58: invalid constant type XyzTypee
myservice/myservice.go:60: invalid constant type XyzTypee
myservice/myservice.go:62: invalid constant type XyzTypee
myservice/myservice.go:64: invalid constant type XyzTypee
type XyzTypee big.Int

const (
    XyzTypee0 XyzTypee = "0"

    XyzTypee1 XyzTypee = "1"

    XyzTypee2 XyzTypee = "2"

    XyzTypee3 XyzTypee = "3"
)

from gowsdl.

md5 avatar md5 commented on May 18, 2024

@danielkwinsor It looks like the problem you're seeing here is that big.Int is not an allowed constant type. Assuming that could be addressed, then the next issue to tackle is that Int.setString will need to be called to parse the enumerated values. Unfortunately, there doesn't seem to be an immutable version of big.Int from my reading of the docs.

from gowsdl.

Halfi avatar Halfi commented on May 18, 2024

Now code generates:

type XyzTypee int32

const (
    XyzTypee0 XyzTypee = "0"

    XyzTypee1 XyzTypee = "1"

    XyzTypee2 XyzTypee = "2"

    XyzTypee3 XyzTypee = "3"
)

Expected

type XyzTypee int32

const (
    XyzTypee0 XyzTypee = 0

    XyzTypee1 XyzTypee = 1

    XyzTypee2 XyzTypee = 2

    XyzTypee3 XyzTypee = 3
)

from gowsdl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.