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

Reserved word should be escaped #163

Closed
dohzya opened this Issue Jun 22, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@dohzya

dohzya commented Jun 22, 2012

I use some WSDL files which contains “type” fields. Scalaxb convert them into

case class  (
  …
  type: Option[String]
  …
)

then Scala refuses to compile.

I think they should be renamed, but at least they should be escaped

case class  (
  …
  `type`: Option[String]
  …
)

Of course I can't just change the name of the field :-)

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jun 22, 2012

Owner

I usually do rename the reserved words tracked in ScalaNames.scala but I guess wsdl case classes somehow slipped through.

Owner

eed3si9n commented Jun 22, 2012

I usually do rename the reserved words tracked in ScalaNames.scala but I guess wsdl case classes somehow slipped through.

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jun 26, 2012

Owner

Could email me the WSDL or put it on gist? I added an element named "type" in some schema but was escaped.

Owner

eed3si9n commented Jun 26, 2012

Could email me the WSDL or put it on gist? I added an element named "type" in some schema but was escaped.

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jun 27, 2012

Owner

Thanks to the wsdl you sent me I was able to locally reproduce the problem.
The problem is partially due to the schema file:

<element name="type " nillable="true" type="xsd:string"/>

Note the whitespace in "type ". Fixing the wsdl should generate improved source.
It seems to generate some bindings without def baseAddress so you could just edit that in manually for now.

I'll keep this case open and see if I can quickly fix the whitespace issue.

Owner

eed3si9n commented Jun 27, 2012

Thanks to the wsdl you sent me I was able to locally reproduce the problem.
The problem is partially due to the schema file:

<element name="type " nillable="true" type="xsd:string"/>

Note the whitespace in "type ". Fixing the wsdl should generate improved source.
It seems to generate some bindings without def baseAddress so you could just edit that in manually for now.

I'll keep this case open and see if I can quickly fix the whitespace issue.

@eed3si9n eed3si9n closed this in e3a80e7 Jun 27, 2012

@eed3si9n

This comment has been minimized.

Show comment
Hide comment
@eed3si9n

eed3si9n Jun 27, 2012

Owner

published 0.7.2-SNAPSHOT with the fix.

Owner

eed3si9n commented Jun 27, 2012

published 0.7.2-SNAPSHOT with the fix.

@dohzya

This comment has been minimized.

Show comment
Hide comment
@dohzya

dohzya Jun 27, 2012

Fantastic! Thank you a lot :-)

dohzya commented Jun 27, 2012

Fantastic! Thank you a lot :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment