Skip to content

Objects inside array with name ending with "List" are generated as "SomeNameList" #780

@DevinHolland

Description

@DevinHolland

Example schema

{
  "title": "example-list-schema",
  "type": "object",
  "properties": {
    "thingList": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "isStuff": {
            "type": "boolean"
          }
        }
      }
    }
  }
}

Output

This generates two class files: ExampleListSchema.class and ThingList.class
ExampleListSchema contains property thingList which is a List<ThingList>.

Expected

I was expecting two class files: ExampleListSchema.class and Thing.class
ExampleListSchema would contain property thingList which would be a List<Thing>

While it is debatable whether the "somethingList" naming pattern is "good", it is a fairly common practice. I would really appreciate support for it in this project.

The class files will parse everything as expected, so this is just a minor inconvenience where a class named "List" isn't actually a list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions