AnyOf in openapi-generator-maven-plugin

Viewed 26

I am using openapi-generator-maven-plugin to generate transport objects from swagger schema. I solve such a problem - I have Object1 and one of the elements must be present in it I got the following object description:

 "Object1" : {
    "anyOf" : [ {
      "properties" : {
        "Object2": {
          "type" : "array",
          "items" : {
            "$ref" : "#/schemas/Object2"
          }
        }
      }
    }, {
      "properties" : {
        "Object3": {
          "type" : "array",
          "items" : {
            "$ref" : "#schemas/Object3"
          }
        }
      }
    } ],
    "description" : "about Object"
  }

But after running object generation I get Object1 with both elements, Object1AnyOf with Object2 only and Object1AnyOf1 with Object3 only.

How can I prevent Object1AnyOf and Object1AnyOf1 from being generated?

0 Answers
Related