File tree Expand file tree Collapse file tree 3 files changed +3
-13
lines changed
__tests__/bundle/self-file-ref-normalization Expand file tree Collapse file tree 3 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -2,16 +2,12 @@ openapi: 3.0.0
22info :
33 title : Self-file ref normalization
44 version : 1.0.0
5- license :
6- name : MIT
75servers :
86 - url : http://example.com
97security : []
108paths :
119 /test :
1210 get :
13- summary : Test
14- operationId : getTest
1511 parameters :
1612 - $ref : ' openapi.yaml#/components/parameters/myParam'
1713 responses :
Original file line number Diff line number Diff line change @@ -2,16 +2,12 @@ openapi: 3.0.0
22info:
33 title: Self-file ref normalization
44 version: 1.0.0
5- license:
6- name: MIT
75servers:
86 - url: http://example.com
97security: []
108paths:
119 /test:
1210 get:
13- summary: Test
14- operationId: getTest
1511 parameters:
1612 - $ref: '#/components/parameters/myParam'
1713 responses:
Original file line number Diff line number Diff line change @@ -339,17 +339,15 @@ function makeBundleVisitor(
339339 return ;
340340 }
341341
342- // Normalize explicit self-file refs to internal pointer
343- if ( ctx . location . source . absoluteRef === resolved . location . source . absoluteRef ) {
344- node . $ref = resolved . location . pointer ;
345- }
346-
347342 if (
348343 resolved . location . source === rootDocument . source &&
349344 resolved . location . source === ctx . location . source &&
350345 ctx . type . name !== 'scalar' &&
351346 ! dereference
352347 ) {
348+ // Normalize explicit self-file refs to internal pointer
349+ node . $ref = resolved . location . pointer ;
350+
353351 return ;
354352 }
355353
You can’t perform that action at this time.
0 commit comments