-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
Description
Description
I am using the example provided in the tests for oneOf. Once I try to generate for typescript-angular I get the three classes:
// apple.ts
export interface Apple {
kind?: string;
}
// banana.ts
export interface Banana {
count?: number;
}
// fruit.ts
import { Apple } from './apple';
import { Banana } from './banana';
export type Fruit = Apple | Banana;
As you can see the color property of fruit is missing.
openapi-generator version
I was using version 4.0.1 with the docker version.
Docker image used was:
openapitools/openapi-generator-cli@sha256:d67438016ccf3067655eb12ce23aab2b6f3e89f916cd153ae9874251af82b3e2
OpenAPI declaration file content or url
openapi: 3.0.1
info:
title: fruity
version: 0.0.1
paths:
/:
get:
responses:
'200':
description: desc
content:
application/json:
schema:
$ref: '#/components/schemas/fruit'
components:
schemas:
fruit:
title: fruit
properties:
color:
type: string
oneOf:
- $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana'
apple:
title: apple
type: object
properties:
kind:
type: string
banana:
title: banana
type: object
properties:
count:
type: number
Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli@sha256:d67438016ccf3067655eb12ce23aab2b6f3e89f916cd153ae9874251af82b3e2 generate \
-i /local/input.yaml \
-g typescript-angular \
-c /local/config.json \
-o /local
Content of config.json is:
{
"apiPackage": "api",
"ngVersion": "6"
}
Steps to reproduce
Execute the test file using the provided command.
Reactions are currently unavailable