Closed michael-land closed 3 years ago
@xiaoyu-tamu There's a problem because this is generated from models, and entities inside models have duplicate names. That's why it's not possible to export from root.
But if you have any technical proposals, we can certainly look into it.
You're right.
I never used OpenAPI generator before, i'm not sure if this is possible.
map this
/**
* The current order status.
* @type {string}
* @memberof Order
*/
OrderStatus: OrderOrderStatusEnum;
to
/**
* The current order status.
* @type {string}
* @memberof Order
*/
OrderStatus: 'Pending' | 'Unshipped' | 'PartiallyShipped' | 'Shipped' | 'Canceled' | 'Unfulfillable' | 'InvoiceUnconfirmed' | 'PendingAvailability';
So, we can get typesafe without export duplicated enums
@nguyentoanit please investigate if this is possible
@xiaoyu-tamu the problem is really not with OpenAPI, but with the way SP API models are designed. It should have been just one model, and no dups, or even if they for some reason wanted to split it up into multiple models, they should have ensured there were not any duplication of names and just namespace all of the entities, but they didn't do that :/
I am in favor of getting rid of enums, as I also think it is annoying to use them.
Hopefully @nguyentoanit can figure out a solution.
:tada: This issue has been resolved in version 2.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I think it would be nice to import types/enums from root
or maybe use string/number literal types instead of enums