[BUG][Java] OpenApi3 to Angular model - generation with oneOf
Created by: pdlk
While generating angular model based on openapi3 json specification, the entity of model generated for types marked as "oneOf" has wrong name including "oneOf" prefix. But this type is not available because it is generated in separated file with proper name without this prefix.
OpenApi Generator: openapi-generator-cli-4.0.3.jar
Initial c# class:
public class ProfileDetail
{
public ProfileData TypicalCustomerProfile { get; set; }
public ProfileData OutlierCustomerProfile { get; set; }
}
Input OpenApi3 JSON definition:
"ProfileDetail": {
"type": "object",
"additionalProperties": false,
"properties": {
"typicalCustomerProfile": {
"nullable": true,
"oneOf": [
{
"$ref": "#/components/schemas/ProfileData"
}
]
},
"outlierCustomerProfile": {
"nullable": true,
"oneOf": [
{
"$ref": "#/components/schemas/ProfileData"
}
]
}
}
},
Generated model - incorrect:
import { OneOfProfileData } from './oneOfProfileData';
export interface ProfileDetail { typicalCustomerProfile?: OneOfProfileData | null; outlierCustomerProfile?: OneOfProfileData | null; }
Expected:
import { ProfileData } from './ProfileData';
export interface ProfileDetail { typicalCustomerProfile?: ProfileData | null; outlierCustomerProfile?: ProfileData | null; }