@scalar/openapi-parser 0.25.12 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/openapi-parser
2
2
 
3
+ ## 0.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#8935](https://github.com/scalar/scalar/pull/8935): feat: pass resolved object to onDereference callback
8
+
3
9
  ## 0.25.12
4
10
 
5
11
  ## 0.25.11
package/README.md CHANGED
@@ -63,7 +63,7 @@ The `dereference` function accepts an `onDereference` callback option that gets
63
63
  import { dereference } from '@scalar/openapi-parser'
64
64
 
65
65
  const { schema, errors } = await dereference(specification, {
66
- onDereference: ({ schema, ref }) => {
66
+ onDereference: ({ schema, ref, resolved }) => {
67
67
  //
68
68
  },
69
69
  })
@@ -14,6 +14,7 @@ export type ResolveReferencesOptions = ThrowOnErrorOption & {
14
14
  onDereference?: (data: {
15
15
  schema: AnyObject;
16
16
  ref: string;
17
+ resolved: AnyObject;
17
18
  }) => void;
18
19
  };
19
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-references.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-references.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAgB5G,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG;IAC1D;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACnE,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAE/B,KAAK,EAAE,SAAS,GAAG,UAAU,EAE7B,OAAO,CAAC,EAAE,wBAAwB,EAElC,IAAI,CAAC,EAAE,eAAe,EAEtB,MAAM,GAAE,WAAW,EAAO,GACzB,uBAAuB,CAuCzB"}
1
+ {"version":3,"file":"resolve-references.d.ts","sourceRoot":"","sources":["../../src/utils/resolve-references.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAgB5G,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG;IAC1D;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,KAAK,IAAI,CAAA;CACxF,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAE/B,KAAK,EAAE,SAAS,GAAG,UAAU,EAE7B,OAAO,CAAC,EAAE,wBAAwB,EAElC,IAAI,CAAC,EAAE,eAAe,EAEtB,MAAM,GAAE,WAAW,EAAO,GACzB,uBAAuB,CAuCzB"}
@@ -99,7 +99,7 @@ errors, options) {
99
99
  }
100
100
  }
101
101
  if (dereferencedRef) {
102
- options?.onDereference?.({ schema, ref: dereferencedRef });
102
+ options?.onDereference?.({ schema, ref: dereferencedRef, resolved });
103
103
  }
104
104
  }
105
105
  // Iterate over the whole object
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "parser",
18
18
  "typescript"
19
19
  ],
20
- "version": "0.25.12",
20
+ "version": "0.26.0",
21
21
  "engines": {
22
22
  "node": ">=22"
23
23
  },