Open
Description
Config & version
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.12.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorName>java</generatorName>
<library>restclient</library>
...
<configOptions>
<ignoreAnyOfInEnum>true</ignoreAnyOfInEnum>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
The processing of the ignoreAnyOfInEnum
param behaves differently depending on how the schema is modeled.
Problem description
The following DOES work:
"type": {
"anyOf": [
{
"type": "string",
"enum": [
"A",
"B",
"C"
],
"description": "Predefined types"
},
{
"type": "string",
"pattern": "^/other.*",
"description": "Non-standard types"
}
]
}
But this one does NOT (which expresses the exact same thing):
"type": {
"anyOf": [
{
"$ref": "#/components/schemas/TypeStandard"
},
{
"$ref": "#/components/schemas/TypeOther"
}
]
},
"TypeStandard": {
"type": "string",
"enum": [
"A",
"B",
"C"
],
"description": "Predefined types"
},
"TypeOther": {
"type": "string",
"pattern": "^/other.*",
"description": "Non-standard types"
},