@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.
- package/dist/index.js +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
|
|
483
|
-
return spec.types?.find((t) => t.name ===
|
|
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))
|