Open
Description
Description
I am using "additionalProperties" in my yaml file as below.
openapi: 3.0.2
....
components:
schemas:
Messages:
type: object
additionalProperties:
$ref: '#/components/schemas/Message'
Message:
type: object
properties:
code:
type: integer
text:
type: string
But when running mvn clean package
, no class is being created for Messages. I was expecting to see a class like :
public class Messages extends HashMap<String, Object> {
......
}
in org.openapitools.client.model.Messages
the same as other classes generated based on the yaml file. I tried additionalProperties: true
and additionalProperties: {}
but none of them worked. It seems like a bug
my pom.xml for openapi-generator and swagger versions
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.1</version>
</dependency>
....
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.3.1</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
...
</execution>
</executions>
</plugin>
Command line used for generation
mvn clean package