-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
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
[BUG][typescript-axios] Using allOf with a $ref and an object, along with withSeparateModelsAndApi
generates broken imports
#9163
Comments
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
We (Jellyfin) are also encountering this issue. openapi.json
|
Same here. Without // ...SNIPPED FOR BREVITY
// @ts-ignore
import { Agency } from '../models';
// @ts-ignore
import { Array<Agency> } from '../models';
// @ts-ignore
import { CreateManyAgencyDto } from '../models';
// @ts-ignore
import { GetManyAgencyResponseDto } from '../models';
// SNIPPED FOR BREVITY... Notice the attempt to import an I think it is related to this definition in one of the import { Agency } from './agency';
/**
*
* @export
* @interface CreateManyAgencyDto
*/
export interface CreateManyAgencyDto {
/**
*
* @type {Array<Agency>}
* @memberof CreateManyAgencyDto
*/
bulk: Array<Agency>;
} And this is the related part of the code in CreateManyAgencyDto:
type: object
properties:
bulk:
type: array
items:
$ref: '#/components/schemas/Agency'
required:
- bulk |
typescript-rxjs also has this problem. btw, withSeparateModelsAndApi only separate models, but apis are still in one file |
Is there some news for this? |
Starting in It appears as though 6430aaf introduced this into |
I have a PR open (#11719) which should fix this. Can any of you using the other TS generators give that a whirl and chime in? |
@funkeyfreak Not sure... #9031 seems unrelated. I'm a bit crunched for time right now, but I'll try to get some tests into my PR soon to get it merged. :) |
any update on this issue? |
This problem worked fine with the 6.6 version but reoccured in the major version 7. Does someone noticed the same? I am using the typescript-axios generator with
It had generate the type |
I am still facing this exact issue. It works correctly with two refs and allOf. But not with one plus properties. Relevant: #16150 |
I'm facing the same issue with Edit: #16150 (comment) |
Bug Report Checklist
Description
Using allOf with a $ref and an object, along with
withSeparateModelsAndApi
generates broken importsopenapi-generator version
5.1.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
default-api.ts
On line 24, it creates an invalid import statement:
import { SomeSchema & object } from '../models';
The text was updated successfully, but these errors were encountered: