acacode / acacode/swagger-typescript-api

How to add import using custom type in primitiveTypeConstructs override

Đang mở
#521 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
4.1k
Fork
436
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello there! I would love to know how I can add import to some custom type to the interfaces generating by Swagger-typescript-api.

I added such option
```js
output: path.resolve(__dirname, './generatedApi/'),
primitiveTypeConstructs: (constructs) => ({
...constructs,
string: {
uuid: 'Guid',
},
}),
```

And in `src/types/Guid.ts` i have this
```js
export type Guid = Opaque<'Guid', string>;
```

I tried many thing but didn't made it work anyhow. I want Swagger-typescript-api to add import on this exact type, so i won't have typescript errors.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.