File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
packages/apidom-reference
src/dereference/strategies/openapi-3-1
test/resolve/strategies/openapi-3-1/discriminator-mapping-object Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -734,6 +734,8 @@ class OpenAPI3_1DereferenceVisitor {
734
734
return false ;
735
735
}
736
736
737
+ this . indirections . push ( memberElement ) ;
738
+
737
739
const [ ancestorsLineage , directAncestors ] = this . toAncestorLineage ( [ ...ancestors , parent ] ) ;
738
740
const parentSchemaElement = [ ...directAncestors ] . findLast ( isSchemaElement ) ;
739
741
const ancestorsSchemaIdentifiers = cloneDeep (
@@ -772,9 +774,10 @@ class OpenAPI3_1DereferenceVisitor {
772
774
773
775
// remove referencing reference from ancestors lineage
774
776
directAncestors . delete ( schemaElement ) ;
777
+ this . indirections . pop ( ) ;
775
778
776
779
// annotate MemberElement with referenced schema
777
- const memberElementCopy : MemberElement = cloneDeep ( memberElement ) ;
780
+ const memberElementCopy : MemberElement = cloneShallow ( memberElement ) ;
778
781
( memberElementCopy . value as StringElement ) . setMetaProperty ( 'ref-schema' , referencedElement ) ;
779
782
780
783
/**
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ describe('resolve', function () {
102
102
// @ts -ignore
103
103
assert . instanceOf ( error . cause . cause , MaximumDereferenceDepthError ) ;
104
104
// @ts -ignore
105
- assert . match ( error . cause . cause . message , / f i x t u r e s \/ m a x - d e p t h \/ e x 2 .j s o n " $ / ) ;
105
+ assert . match ( error . cause . cause . message , / f i x t u r e s \/ m a x - d e p t h \/ e x 1 .j s o n " $ / ) ;
106
106
}
107
107
} ) ;
108
108
} ) ;
You can’t perform that action at this time.
0 commit comments