@openpkg-ts/spec 0.47.0 → 0.48.1

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -479,8 +479,8 @@ function resolveRef(schema, spec) {
479
479
  const prefix = "#/types/";
480
480
  if (!schema.$ref.startsWith(prefix))
481
481
  return null;
482
- const name = schema.$ref.slice(prefix.length);
483
- return spec.types?.find((t) => t.name === name) ?? null;
482
+ const ref = schema.$ref.slice(prefix.length);
483
+ return spec.types?.find((t) => t.id === ref) ?? spec.types?.find((t) => t.name === ref) ?? null;
484
484
  }
485
485
  function flattenAnyOf(schema) {
486
486
  if (!isAnyOfSchema(schema))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpkg-ts/spec",
3
- "version": "0.47.0",
3
+ "version": "0.48.1",
4
4
  "description": "Shared schema, validation, and diff utilities for OpenPkg specs",
5
5
  "keywords": [
6
6
  "openpkg",