我additionalPropertes
在我的 OpenAPI 定义中使用来引用地图对象。我的 OAS 部分如下所示:
Configuration:
title: Configuration Info
type: object
additionalProperties:
type: string
description: The config parameters.
example:
configName: header
configValue: Context
configId: "12"
使用openapi-generator
4.3.1 版的 maven codegen 插件生成代码并具有以下配置时,不会为模型生成模型类Configuration
。
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>api.yaml</inputSpec>
<language>jaxrs-cxf-cdi</language>
<configOptions>
<apiPackage>${api-package}</apiPackage>
<modelPackage>${model-package}</modelPackage>
<sourceFolder>src/gen/java</sourceFolder>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
我们如何为additionalProperties
OAS 中的对象生成模型类?