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

Failed to generate types when schemas are not in a reticular structure #306

Open
C-ra-ZY opened this issue Sep 2, 2024 · 2 comments
Open

Comments

@C-ra-ZY
Copy link
Contributor

C-ra-ZY commented Sep 2, 2024

Describe the bug
If there are no $ref in schemas, current code would skip the procedure of generating types, whereas the other outputs are normal, like schemas and endpoint.
Although is not a common demand, spliting types info into a single file would take effect on decoupling and customization.

Minimal reproduction
please see this page

Expected behavior
the output should contain types information anyway like:

type DemoInformation = {
  issuedTo: string;
  token: string;
  expirationDate: string;
  group: string;
  identityId: string;
};

Additional context
I have drafted fix.

@misl-smlz
Copy link

We are experiencing the same issue described in this thread and would like to inquire about the status of a fix.

@astahmer Is there an estimated timeline for resolving this problem? Additionally, we are willing to assist in addressing the issue; please let us know how we can contribute. Is this project still active?

@astahmer
Copy link
Owner

hey, sorry I don't have time to maintain this project anymore

I think it's in a ok-state for trivial use cases but has too many issues otherwise (currently 63 opened), I would not recommend using this
it also suffers from being tightly coupled to zod; which leads to performance issues in the IDE (intellisense taking seconds instead of milliseconds) due to Typescript LSP dying when you have a generated client file with more than [~3k to 5k] lines

if you just need a typed API client based on an OpenAPI spec (with optional runtime validation, e.g it can spit TS types without zod if you want), then I also made typed-openapi which does that job just fine and gives you control on the fetcher implementation

I think there are great alternatives out there, I havent tried those but it seemed good:

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

3 participants