open api generator oneof

Viewed 564

using 4.3.1 of open api generator and trying to get the java code out of the json.

In the json file I have the following (changed for example):

"xComponents": {
        "type": "array",
        "title": "This is a title",
        "items": {
          "oneOf": [
            {
              "$ref": "xComponent.AAA.schema.json"
            },
            {
              "$ref": "xComponent.BBB.schema.json"
            },
            {
              "$ref": "xComponent.CCC.schema.json"
            },
            {
              "$ref": "xComponent.DDD.schema.json"
            }
          ],
          "type": "object"
        },
        "minItems": 1
      }

It generates this list wierd class name that cannot get build:

private List<**OneOfxComponentAAASchemaJsonxComponentBBBSchemaJsonxComponentCCCSchemaJsonxComponentDDDSchemaJson**> xComponents = 
    new ArrayList<**OneOfxComponentAAASchemaJsonxComponentBBBSchemaJsonxComponentCCCSchemaJsonxComponentDDDSchemaJson**>();

Whats the correct way to deal with oneOf? what im I doing wrong (either with the json file or with the open api generator)?

0 Answers
Related