You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm using gowsdl to generate code for an ancient API.
The problem I ran into is while their WSDL definition states something is a time.Time the actual format of the string is not one that time.Parse can use. It would be great if there was an option on the CLI to specify that any time.Time instances should be string instead.
To do this myself, I've had to do a bit of sed magic in go:generate directives:
// Produces go code from the WSDL file.//go:generate gowsdl -o ./generated.go -p generated <url>// This is some gross stuff right here. Basically, this API does not return time strings in a way that go can parse them. So// we use sed to replace them all with strings//go:generate sed -i "s/time.Time/string/g" ./generated/generated.go// Then we need to get rid of the "time" import at the top.//go:generate sed -i "s/\"time\"//g" ./generated/generated.go
While I don't mind doing it this way, I figure many people who are using soap and go are probably dealing with old APIs that have quirks like this one. So perhaps some built-in way of replacing types would be beneficial? What do you think?
I appreciate it's probably a non-goal of this tool, since the API itself is doing something it shouldn't.
The text was updated successfully, but these errors were encountered:
Hello, I'm using gowsdl to generate code for an ancient API.
The problem I ran into is while their WSDL definition states something is a
time.Time
the actual format of the string is not one thattime.Parse
can use. It would be great if there was an option on the CLI to specify that anytime.Time
instances should bestring
instead.To do this myself, I've had to do a bit of
sed
magic ingo:generate
directives:While I don't mind doing it this way, I figure many people who are using soap and go are probably dealing with old APIs that have quirks like this one. So perhaps some built-in way of replacing types would be beneficial? What do you think?
I appreciate it's probably a non-goal of this tool, since the API itself is doing something it shouldn't.
The text was updated successfully, but these errors were encountered: