Skip to content

Commit

Permalink
fix( #1558): Discrepancy in addUsedSchema between v6 and v8
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin-chaurasiya committed Oct 16, 2023
1 parent 490eb8c commit 7767534
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/compile/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): Loc
// eslint-disable-next-line @typescript-eslint/unbound-method
const _resolve = this.opts.uriResolver.resolve
ref = normalizeId(baseId ? _resolve(baseId, ref) : ref)
if (this.opts.addUsedSchema === false) return ref // skip adding schema reference
if (schemaRefs.has(ref)) throw ambiguos(ref)
schemaRefs.add(ref)
let schOrRef = this.refs[ref]
Expand Down

0 comments on commit 7767534

Please sign in to comment.