We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If allOf is used, it tries to import a nested model that is not used. import must be used or deleted.
target schemas
Response: type: string example: success enum: - success - error Box: type: object properties: id: type: number example: 1 name: type: string example: inbox box: $ref: '#/components/schemas/BoxInBox' BoxInBox: 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
import { Box } from './box'; import { BoxInBox } from './box-in-box'; import { Response } from './response'; /** * * @export * @interface BoxesResponse */ export interface BoxesResponse { /** * * @type {string} * @memberof BoxesResponse */ status: BoxesResponseStatusEnum; /** * * @type {number} * @memberof BoxesResponse */ id?: number; /** * * @type {string} * @memberof BoxesResponse */ name?: string; /** * * @type {BoxInBox} * @memberof BoxesResponse */ box?: BoxInBox; } /** * @export * @enum {string} */ export enum BoxesResponseStatusEnum { Success = 'success', Error = 'error' }
expected
import { Box } from './box'; import { Response } from './response'; /** * * @export * @interface BoxesResponse */ export type BoxesResponse = Response & Box;
4.2.2
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 box: $ref: '#/components/schemas/BoxInBox' BoxInBox: type: object properties: id: type: number example: 1 name: type: string example: inbox BoxesResponse: allOf: - $ref: '#/components/schemas/Response' - $ref: '#/components/schemas/Box'
openapi-generator generate -i openapi.yml -g typescript-axios -o apis -p withSeparateModelsAndApi=true --api-package apis --model-package models
N/A
#4629
#4805
The text was updated successfully, but these errors were encountered:
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
If allOf is used, it tries to import a nested model that is not used.
import must be used or deleted.
target schemas
generated typescript file
expected
openapi-generator version
4.2.2
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
N/A
Related issues/PRs
#4629
Suggest a fix
#4805
The text was updated successfully, but these errors were encountered: