File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -23,24 +23,6 @@ export interface InventoryEntry {
23
23
value : any ;
24
24
}
25
25
26
- /**
27
- * Determines whether an internal $ref should be inlined (copied) rather than left as a $ref.
28
- * Currently inlines OpenAPI path items ("#/paths/..."), while keeping components/definitions/declarations as refs.
29
- */
30
- const shouldInlineInternal = ( entry : InventoryEntry ) => {
31
- if ( entry . external ) {
32
- return false ;
33
- }
34
- const h = entry . hash as string | undefined ;
35
- if ( ! h || h === "#" ) {
36
- return false ;
37
- }
38
- if ( h . startsWith ( "#/components/schemas" ) || h . startsWith ( "#/definitions" ) ) {
39
- return false ;
40
- }
41
- return h . startsWith ( "#/paths/" ) ;
42
- } ;
43
-
44
26
/**
45
27
* TODO
46
28
*/
@@ -318,7 +300,7 @@ function remap(inventory: InventoryEntry[]) {
318
300
for ( const entry of inventory ) {
319
301
// console.log('Re-mapping $ref pointer "%s" at %s', entry.$ref.$ref, entry.pathFromRoot);
320
302
321
- if ( ! entry . external && ! shouldInlineInternal ( entry ) ) {
303
+ if ( ! entry . external && ! entry . hash ?. startsWith ( "#/paths/" ) ) {
322
304
// This $ref already resolves to the main JSON Schema file
323
305
entry . $ref . $ref = entry . hash ;
324
306
} else if ( entry . file === file && entry . hash === hash ) {
You can’t perform that action at this time.
0 commit comments