allOf in schema property results in generation of invalid Java methods "putXXXItem"
Created by: hoodihub
Disclaimer: I face these issues when generating a Java SDK, I don't know whether it affects other languages too.
Problem: I'm currently using version 5.3.0 of the generator, and with this version it generates some invalid methods for a schema's class, if the schema contains a property with an allOf element.
yaml:
MyType:
required:
- category
type: object
properties:
category:
type: object
description: |-
<strong>Type:</strong> Category<br/>
The category
allOf:
- $ref: '#/components/schemas/Category'
The generated java class for MyType contains this method which doesn't compile:
public MyType putCategoryItem(String key, categoryItem) {
this.category.put(key, categoryItem);
return this;
}
First of all, you can see that there's no type declaration for the "categoryItem" parameter. Also, "this.category" is not a map, but a reference to the Category class (which is correct).
This whole method doesn't make sense to me. The previous version of the generator that I used was version 5.0.1, and that version didn't contain these invalid "putXXXItem" methods.
Can you explain where this comes from, and how I would have to change my yaml file so that those methods are no longer created?