Skip to content
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] Circularly references when using discriminator #857

Open
alSergey opened this issue Aug 1, 2024 · 1 comment
Open

[Bug] Circularly references when using discriminator #857

alSergey opened this issue Aug 1, 2024 · 1 comment

Comments

@alSergey
Copy link

alSergey commented Aug 1, 2024

Describe the bug

When using discliminator, cyclic dependencies appear in types. The problem appeared in version 13.0.0, where support was added.

swagger-typescript-api@12.0.4

There was no discriminator support in this version, so the problem does not occur.

image

swagger-typescript-api@13.0.0

This version added support for discriminator, but it does not work correctly. This causes circular type references.

image

openapi-typescript@7.0.2

This library supports discriminator and there are no problems with cyclic type references.

image

Reproduction

Open StackBlitz:

  • swagger-typescript-api@12.0.4 - generated/Api12.ts
  • swagger-typescript-api@13.0.0 - generated/Api13.ts
  • openapi-typescript@7.0.2 - generated/Api.ts
@MiracleUFO
Copy link

Facing same issue with 13.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants