Open chasewallis opened 2 weeks ago
Thank you for reporting @chasewallis
@chasewallis what would be the expected result for you?
In unrelated news, I found the matcher responsible for this issue, but waiting for your response before prioritising this
Sorry, been in vacation and still am. The only thing I really care about is that the generic types are represented as different types and not the same. So I guess the expected result in the example given would be that the 2 endpoints return types that truly represent the generic type.
Thank you, enjoy your vacation!
Description
We've got a number of types with generics. It appears that only 1 (first or last) wins the generic game and is used as the type for all.
For example, we've got endpoints that return something like this: (C#)
ItemModel<bool>
andItemModel<string>
. We've also got very deeply nested generic types, but this is enough to see the issue. Those get generated correctly to swagger.json:and
And the relevant section in the
components: { schemas:
section:So that all looks fine, but when the hey-api tool is ran, I get something like this in the types.gen.ts:
So both responses are now returning the exact same type and completely ignoring the generic-ness of the types.
There is a very good chance I am using the tool wrong, have something misconfigured, etc. But I haven't found anything in the documentation that might help. I'm running the above with the most simple args to the tool, just in and out params.
Included is the swagger file I used to reproduce the issue.
test2.json
Reproducible example or configuration
openapi-ts -i provided.json -o genericsNotWorking
OpenAPI specification (optional)
System information (optional)
No response