Skip to content

Commit

Permalink
Remove duplicate resolveType() function (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwouts authored and committedteadrinker committed Jun 5, 2019
1 parent 0ebbe68 commit 74f3f90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
4 changes: 2 additions & 2 deletions lib/src/generators/contract/openapi3-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TypeKind,
UnionType
} from "../../models/types";
import { resolveType } from "../../models/types/resolve-type";
import { resolveType } from "../../verifiers/utilities/type-resolver";

function isStringConstantUnion(type: UnionType): boolean {
return type.types.reduce<boolean>((acc, type) => {
Expand Down Expand Up @@ -175,7 +175,7 @@ function inferDiscriminator(
// Optional properties cannot be discriminators, since they may not always be present.
continue;
}
const resolvedPropertyType = resolveType(types, property.type);
const resolvedPropertyType = resolveType(property.type, types);
if (resolvedPropertyType.kind === TypeKind.STRING_LITERAL) {
possibleDiscriminators[property.name] =
possibleDiscriminators[property.name] || {};
Expand Down
16 changes: 0 additions & 16 deletions lib/src/models/types/resolve-type.ts

This file was deleted.

0 comments on commit 74f3f90

Please sign in to comment.