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
Codegen on swaggerhub generates Jersey and Resteasy code that doesn't compile when properties contain '@' sign.
Codegen generates improper Java fields. Eg. for '@basetype' swagger property definition there is @basetype field name generated, and also getter/setter names are broken.
properties:
'@baseType':
type: stringdefault: 'Attachment'description: The base type for use in polymorphic collections
Command line used for generation
Not applicable. I was using online codegen from swagger.io. I'll make tests on "standalone" version soon.
Steps to reproduce
Export -> Server stub -> jaxrs-jersey or jaxrs-resteasy
Related issues/PRs
Suggest a fix/enhancement
Codegen should "sanitize" such property names and exclude not allowed chars from field and getter/setter names. @JsonProperty annotation should be sufficient to reflect swagger contract for such properties.
I'll try to make a fix in codegen and post my solution soon.
The text was updated successfully, but these errors were encountered:
Description
Codegen on swaggerhub generates Jersey and Resteasy code that doesn't compile when properties contain '@' sign.
Codegen generates improper Java fields. Eg. for '@basetype' swagger property definition there is @basetype field name generated, and also getter/setter names are broken.
Swagger-codegen version
Not sure. The one from swagger.io.
Swagger declaration file content or url
I came across this issue while trying to implement TMF 655 Swagger API: https://raw.githubusercontent.com/tmforum-apis/TMF655_ChangeManagement/master/Change_Management.admin.swagger.json.
Command line used for generation
Not applicable. I was using online codegen from swagger.io. I'll make tests on "standalone" version soon.
Steps to reproduce
Export -> Server stub -> jaxrs-jersey or jaxrs-resteasy
Related issues/PRs
Suggest a fix/enhancement
Codegen should "sanitize" such property names and exclude not allowed chars from field and getter/setter names. @JsonProperty annotation should be sufficient to reflect swagger contract for such properties.
I'll try to make a fix in codegen and post my solution soon.
The text was updated successfully, but these errors were encountered: