@kubb/adapter-oas 5.28.4 → 5.28.5

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 CHANGED
@@ -17,7 +17,7 @@ var compatibility = {
17
17
  "node": ">=22.22"
18
18
  };
19
19
  // package.json
20
- var version = "5.28.4";
20
+ var version = "5.28.5";
21
21
  // src/constants.ts
22
22
  /**
23
23
  * Default parser options applied when no explicit options are provided.
@@ -958,8 +958,10 @@ function parse(source) {
958
958
  function rememberEvents({ source, events }) {
959
959
  indexes.set(source, indexEvents(events));
960
960
  }
961
+ const withoutAllOf = (pointer) => pointer.replace(/\/allOf\/\d+(?=\/|$)/g, "");
961
962
  /**
962
- * Maps OpenAPI JSON pointers and unresolved references to ranges in YAML or JSON source.
963
+ * Maps OpenAPI JSON pointers and unresolved references to ranges in YAML or JSON source. A pointer through an `allOf`
964
+ * the spec does not have falls back to the same pointer without its `allOf` steps.
963
965
  */
964
966
  const locate = (source, location) => {
965
967
  if (!("pointer" in location)) return void 0;
@@ -970,7 +972,8 @@ const locate = (source, location) => {
970
972
  source
971
973
  });
972
974
  const ref = "ref" in location ? location.ref : void 0;
973
- return locator.find(location.pointer) ?? (ref ? locator.findRef(ref) : void 0);
975
+ const flattened = withoutAllOf(location.pointer);
976
+ return locator.find(location.pointer) ?? (flattened === location.pointer ? void 0 : locator.find(flattened)) ?? (ref ? locator.findRef(ref) : void 0);
974
977
  };
975
978
  // src/load/source.ts
976
979
  const urlRegExp = /^https?:\/+/i;