Skip to content

Commit

Permalink
fix(faker ref resolver): use original name of referenced schema in re…
Browse files Browse the repository at this point in the history
…f resolution (#1510)

use original name of referenced schema in ref resolution

fix #1500

Co-authored-by: George Musker <george.musker@connexone.co.uk>
  • Loading branch information
GMusk and George Musker authored Jul 9, 2024
1 parent 6b9eaf9 commit 916e277
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mock/src/faker/resolvers/value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const resolveMockValue = ({
}): MockDefinition & { type?: string } => {
if (isReference(schema)) {
const {
name,
originalName,
specKey = context.specKey,
refPaths,
} = getRefInfo(schema.$ref, context);
Expand All @@ -89,7 +89,7 @@ export const resolveMockValue = ({

const newSchema = {
...schemaRef,
name,
name: originalName,
path: schema.path,
isRef: true,
};
Expand Down

0 comments on commit 916e277

Please sign in to comment.