Omit doesn't seem to work
See original GitHub issueSorting
-
I’m submitting a …
- bug report
- feature request
- support request
-
I confirm that I
- used the search to make sure that a similar issue hasn’t already been submit
Expected Behavior
Omit should be able to be used to create types.
Current Behavior
An error is generated:
Error: No matching model found for referenced type Omit. If Omit comes from a dependency, please create an interface in your own code that has the same structure. Tsoa can not utilize interfaces from external dependencies. Read more at https://github.com/lukeautry/tsoa/blob/master/docs/ExternalInterfacesExplanation.MD
Reproduction Code
export interface NewIndicator extends Omit<IndicatorBase, 'formula'> {
ownerId?: string | null;
formula?: string;
}
Context (Environment)
Version of the library: 3.4.0 Version of NodeJS: 13.14.0
- Confirm you were using yarn not npm: [X]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9
Top Results From Across the Web
Omit not working as it should? Or I'm not using Omit as I should?
I am using mysql2 for this. export interface MemberDto { guild_id: string; member_id: string; house: keyof typeof Houses | null; ...
Read more >Why does TypeScript's Omit not enforce the value of the ...
So Omit seems like a good candidate to me, but the keys to omit can be of any string value. Question: Why does...
Read more >The Omit Helper Type in TypeScript - Marius Schulz
First, we need to be able to retrieve all keys of the User type. We can use the keyof operator to retrieve a...
Read more >Program Is Not Listed in Add/Remove Programs After Installation
This problem can occur if the program you installed creates a registry key name that is longer than 60 characters in length. Add/Remove...
Read more >Delete does not work in AutoCAD
Delete does not work in AutoCAD · Solution: · PICKFIRST system variable. Enable pre-command selection by doing the following: · Hardware-related ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We use
Omit
a lot throughout our tests, which makes me fairly confident in asserting that it’s not us. Everything else you said has nothing to do with the issue.Location is still in
node_modules
, which you probably are still excluding from your program.My advice would be to not down vote for giving you a hint despite the duplicated issue and instead prove your issue with a repro if you’re so confident it’s an issue.
I don’t tend to actively close issues which are unresolved. However, most of this discussion is a duplicate of https://github.com/lukeautry/tsoa/issues/774 and https://github.com/lukeautry/tsoa/issues/784 as well as the list of issues listed in #774:
Tl:Dr from there: The error message should be improved, but external dependencies can be resolved if you include them. However, including everything in
node_modules
for example carries a build performance penalty, which is why we generally don’t recommend it. If you can, just include the types which are used at the edge of your program to build the spec and the routes (read: controller methods).