openapi-typescript-codegen icon indicating copy to clipboard operation
openapi-typescript-codegen copied to clipboard

Problem with migration to @hey-api/openapi-ts

Open stq opened this issue 10 months ago • 4 comments

There is a problem with migration to @hey-api/openapi-ts

This solution provides a clean service/model generation per-file , while @hey-api/openapi-ts maintainer clearly degraded this solution back to generation of huge unmaintainable all-in-one file.

Can you please remove suggestion to migrate to @hey-api/openapi-ts since it is step backward, and just state clearly there is no another continuing project with same traits as this?

stq avatar Jan 20 '25 11:01 stq

Hi @stq, this feature has been requested a few times already, so I'll assume you're voting +1 on it. I'm curious about the unmaintainable comment, what exactly do you mean by that?

mrlubos avatar Jan 20 '25 12:01 mrlubos

If I can add my two pence, I prefer heygen's implementation in many ways, but if you automatically generate the file from a swagger JSON, it completely rewrites the entire sdk.gen.ts and types.gen.ts files every time. Even with no changes to the swagger, it will reorder everything in the ts files, whilst it should be stable.

This is something I've been googling to try and resolve but might be an issue to open on the other side

I think the term I'm looking for is "non-deterministic"

MaffooBristol avatar Mar 17 '25 12:03 MaffooBristol

@MaffooBristol Would you be able to open an issue? I'm curious how to reproduce this because I'm not seeing the same – same input = same output

mrlubos avatar Mar 17 '25 14:03 mrlubos

+1 here, We have 5k+ files project and migration to @hey-api/openapi-ts is impossible because of thousands of broken imports.

kmihaltsov avatar Mar 20 '25 20:03 kmihaltsov

For anyone finding this thread in the future, you can now split the output almost however you like

mrlubos avatar Nov 04 '25 05:11 mrlubos