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

Invalid code generation when using collections of generated types #46

Open
bm-w opened this issue Apr 30, 2021 · 0 comments
Open

Invalid code generation when using collections of generated types #46

bm-w opened this issue Apr 30, 2021 · 0 comments

Comments

@bm-w
Copy link
Contributor

bm-w commented Apr 30, 2021

Take for example this (partial) schema, where the root type has a field that’s a list of element of another generated type:

{ …, "types": [
  {
    "name": "Root",
    "description": "The table’s root type",
    "fields": [
      { "name": "id", "dynamoName": "id", "description": "The hash key", "type": "String" },
      { "name": "listOfGenerated", "dynamoName": "logen", "type": "List", "elementType": "GeneratedListElement" }
    ]
  },
  {
    "name": "GeneratedListElement",
    "fields": [
      { "name": "foo", "dynamoName": "foo", "type": "String" }
    ]
  }
] }

The generated RootBean class will have the following annotated member variable, where the argument to the annotation contains invalid syntax:

@JsonDeserialize(as=List<GeneratedListElement>Bean.class)
private List< GeneratedListElement> listOfGenerated;

This invalid code is generated by line 42 of bean.ftl (as of current master, 952ed0e):

@JsonDeserialize(as=<@field_type field=field />Bean.class)
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