Bug Report Checklist
Description
If allOf is used, a model that does not use import will be generated.
Because my project prohibits unused import, an error occurs in typescript.
import must be used or deleted.
taget schemas
Response:
type: string
example: success
enum:
- success
- error
Box:
type: object
properties:
id:
type: number
example: 1
name:
type: string
example: inbox
BoxesResponse:
allOf:
- $ref: '#/components/schemas/Response'
- $ref: '#/components/schemas/Box'
generated typescript file
// tslint:disable
/**
* My application
* My application
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import {
Box,
Response,
} from './';
/**
* @export
* @interface BoxResponse
*/
export interface BoxResponse extends Box, Response{
/**
* @type {string}
* @memberof BoxResponse
*/
status?: BoxResponseStatusEnum;
/**
* @type {number}
* @memberof BoxResponse
*/
id?: number;
/**
* @type {string}
* @memberof BoxResponse
*/
name?: string;
}
/**
* @export
* @enum {string}
*/
export enum BoxResponseStatusEnum {
Success = 'success',
Error = 'error'
}
expected
// tslint:disable
/**
* My application
* My application
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import {
Box,
Response,
} from './';
/**
* @export
* @interface BoxResponse
*/
export interface BoxResponse extends Box, Response {
}
openapi-generator version
4.2.0
OpenAPI declaration file content or url
openapi: 3.0.2
info:
title: My application
version: 1.0.0
description: My application
tags:
- name: Box
paths:
/boxes:
get:
summary: Box list
description: Box list
operationId: showBoxes
tags:
- Box
responses:
200:
description: Box list
content:
application/json:
schema:
$ref: '#/components/schemas/BoxesResponse'
components:
schemas:
Response:
type: string
example: success
enum:
- success
- error
Box:
type: object
properties:
id:
type: number
example: 1
name:
type: string
example: inbox
BoxesResponse:
allOf:
- $ref: '#/components/schemas/Response'
- $ref: '#/components/schemas/Box'
Command line used for generation
$ openapi-generator generate -i openapi.yml -g typescript-rxjs -o apis
Steps to reproduce
N/A
Related issues/PRs
N/A
Suggest a fix
Checking now
Bug Report Checklist
Description
If allOf is used, a model that does not use import will be generated.
Because my project prohibits unused import, an error occurs in typescript.
import must be used or deleted.
taget schemas
generated typescript file
expected
openapi-generator version
4.2.0
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
N/A
Related issues/PRs
N/A
Suggest a fix
Checking now