Skip to content

Commit

Permalink
fix: use defaultVersion as a fallback to controller version
Browse files Browse the repository at this point in the history
Closes #1631
  • Loading branch information
micalevisk committed Oct 21, 2021
1 parent c4492d4 commit 84f1761
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/swagger-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,11 @@ export class SwaggerExplorer {
metatype: Type<unknown> | Function,
versioningOptions: VersioningOptions | undefined
): VersionValue | undefined {
return versioningOptions?.type === VersioningType.URI
? Reflect.getMetadata(VERSION_METADATA, metatype)
: undefined;
if (versioningOptions?.type === VersioningType.URI) {
return (
Reflect.getMetadata(VERSION_METADATA, metatype) ??
versioningOptions.defaultVersion
);
}
}
}

0 comments on commit 84f1761

Please sign in to comment.