@swagger-api/apidom-json-path 1.0.0-beta.33 → 1.0.0-beta.35
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 +10 -0
- package/dist/apidom-json-path.browser.js +8 -8
- package/package.json +5 -5
- package/src/evaluate-multi.cjs +2 -2
- package/src/evaluate-multi.mjs +1 -1
- package/src/evaluate.cjs +2 -2
- package/src/evaluate.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-beta.35](https://github.com/swagger-api/apidom/compare/v1.0.0-beta.34...v1.0.0-beta.35) (2025-05-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @swagger-api/apidom-json-path
|
|
9
|
+
|
|
10
|
+
# [1.0.0-beta.34](https://github.com/swagger-api/apidom/compare/v1.0.0-beta.33...v1.0.0-beta.34) (2025-05-02)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **ns-openapi-3-1:** use spec compliant JSON Pointer implementation ([#4880](https://github.com/swagger-api/apidom/issues/4880)) ([9499aa8](https://github.com/swagger-api/apidom/commit/9499aa8733445f15ec7441c7f87b89dab8542c49)), closes [#4870](https://github.com/swagger-api/apidom/issues/4870)
|
|
15
|
+
|
|
6
16
|
# [1.0.0-beta.33](https://github.com/swagger-api/apidom/compare/v1.0.0-beta.32...v1.0.0-beta.33) (2025-04-30)
|
|
7
17
|
|
|
8
18
|
### Bug Fixes
|
|
@@ -2942,8 +2942,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2942
2942
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
2943
2943
|
/* harmony export */ });
|
|
2944
2944
|
/* harmony import */ var jsonpath_plus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3357);
|
|
2945
|
-
/* harmony import */ var
|
|
2946
|
-
/* harmony import */ var
|
|
2945
|
+
/* harmony import */ var _swagger_api_apidom_json_pointer_modern__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4808);
|
|
2946
|
+
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1776);
|
|
2947
2947
|
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6941);
|
|
2948
2948
|
/* harmony import */ var _errors_EvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3424);
|
|
2949
2949
|
|
|
@@ -2961,13 +2961,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2961
2961
|
*/
|
|
2962
2962
|
const evaluate = (path, element) => {
|
|
2963
2963
|
try {
|
|
2964
|
-
const json = (0,
|
|
2964
|
+
const json = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
|
|
2965
2965
|
const pointers = (0,jsonpath_plus__WEBPACK_IMPORTED_MODULE_0__.JSONPath)({
|
|
2966
2966
|
path,
|
|
2967
2967
|
json,
|
|
2968
2968
|
resultType: 'pointer'
|
|
2969
2969
|
});
|
|
2970
|
-
return pointers.map(pointer => (0,
|
|
2970
|
+
return pointers.map(pointer => (0,_swagger_api_apidom_json_pointer_modern__WEBPACK_IMPORTED_MODULE_2__.evaluate)(element, pointer));
|
|
2971
2971
|
} catch (error) {
|
|
2972
2972
|
throw new _errors_EvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__["default"](`JSON Path evaluation failed while evaluating "${String(path)}".`, {
|
|
2973
2973
|
path,
|
|
@@ -12864,8 +12864,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12864
12864
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
12865
12865
|
/* harmony export */ });
|
|
12866
12866
|
/* harmony import */ var jsonpath_plus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3357);
|
|
12867
|
-
/* harmony import */ var
|
|
12868
|
-
/* harmony import */ var
|
|
12867
|
+
/* harmony import */ var _swagger_api_apidom_json_pointer_modern__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4808);
|
|
12868
|
+
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1776);
|
|
12869
12869
|
/* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6941);
|
|
12870
12870
|
/* harmony import */ var _errors_MultiEvaluationJsonPathError_ts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(427);
|
|
12871
12871
|
|
|
@@ -12887,7 +12887,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12887
12887
|
*/
|
|
12888
12888
|
const evaluateMulti = (paths, element) => {
|
|
12889
12889
|
try {
|
|
12890
|
-
const json = (0,
|
|
12890
|
+
const json = (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element);
|
|
12891
12891
|
const results = [];
|
|
12892
12892
|
for (const path of paths) {
|
|
12893
12893
|
const pointers = (0,jsonpath_plus__WEBPACK_IMPORTED_MODULE_0__.JSONPath)({
|
|
@@ -12897,7 +12897,7 @@ const evaluateMulti = (paths, element) => {
|
|
|
12897
12897
|
});
|
|
12898
12898
|
const endPointValues = [];
|
|
12899
12899
|
for (const pointer of pointers) {
|
|
12900
|
-
const endPointValue = (0,
|
|
12900
|
+
const endPointValue = (0,_swagger_api_apidom_json_pointer_modern__WEBPACK_IMPORTED_MODULE_2__.evaluate)(element, pointer);
|
|
12901
12901
|
endPointValues.push(endPointValue);
|
|
12902
12902
|
}
|
|
12903
12903
|
if (Array.isArray(path)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swagger-api/apidom-json-path",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.35",
|
|
4
4
|
"description": "Evaluate JSONPath expressions against ApiDOM.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"license": "Apache-2.0",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime-corejs3": "^7.26.10",
|
|
41
|
-
"@swagger-api/apidom-core": "^1.0.0-beta.
|
|
42
|
-
"@swagger-api/apidom-error": "^1.0.0-beta.
|
|
43
|
-
"@
|
|
41
|
+
"@swagger-api/apidom-core": "^1.0.0-beta.35",
|
|
42
|
+
"@swagger-api/apidom-error": "^1.0.0-beta.35",
|
|
43
|
+
"@swagger-api/apidom-json-pointer": "^1.0.0-beta.35",
|
|
44
44
|
"jsonpath-plus": "^10.0.6"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"README.md",
|
|
54
54
|
"CHANGELOG.md"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "86f79af3f51d7e803585badca9d35340bf85a09d"
|
|
57
57
|
}
|
package/src/evaluate-multi.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.default = void 0;
|
|
6
6
|
var _jsonpathPlus = require("jsonpath-plus");
|
|
7
|
-
var
|
|
7
|
+
var _modern = require("@swagger-api/apidom-json-pointer/modern");
|
|
8
8
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
9
9
|
var _MultiEvaluationJsonPathError = _interopRequireDefault(require("./errors/MultiEvaluationJsonPathError.cjs"));
|
|
10
10
|
/**
|
|
@@ -31,7 +31,7 @@ const evaluateMulti = (paths, element) => {
|
|
|
31
31
|
});
|
|
32
32
|
const endPointValues = [];
|
|
33
33
|
for (const pointer of pointers) {
|
|
34
|
-
const endPointValue = (0,
|
|
34
|
+
const endPointValue = (0, _modern.evaluate)(element, pointer);
|
|
35
35
|
endPointValues.push(endPointValue);
|
|
36
36
|
}
|
|
37
37
|
if (Array.isArray(path)) {
|
package/src/evaluate-multi.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONPath } from 'jsonpath-plus';
|
|
2
|
-
import { evaluate as jsonPointerEvaluate } from '@
|
|
2
|
+
import { evaluate as jsonPointerEvaluate } from '@swagger-api/apidom-json-pointer/modern';
|
|
3
3
|
import { toValue, cloneDeep } from '@swagger-api/apidom-core';
|
|
4
4
|
import MultiEvaluationJsonPathError from "./errors/MultiEvaluationJsonPathError.mjs";
|
|
5
5
|
/**
|
package/src/evaluate.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.default = void 0;
|
|
6
6
|
var _jsonpathPlus = require("jsonpath-plus");
|
|
7
|
-
var
|
|
7
|
+
var _modern = require("@swagger-api/apidom-json-pointer/modern");
|
|
8
8
|
var _apidomCore = require("@swagger-api/apidom-core");
|
|
9
9
|
var _EvaluationJsonPathError = _interopRequireDefault(require("./errors/EvaluationJsonPathError.cjs"));
|
|
10
10
|
/**
|
|
@@ -23,7 +23,7 @@ const evaluate = (path, element) => {
|
|
|
23
23
|
json,
|
|
24
24
|
resultType: 'pointer'
|
|
25
25
|
});
|
|
26
|
-
return pointers.map(pointer => (0,
|
|
26
|
+
return pointers.map(pointer => (0, _modern.evaluate)(element, pointer));
|
|
27
27
|
} catch (error) {
|
|
28
28
|
throw new _EvaluationJsonPathError.default(`JSON Path evaluation failed while evaluating "${String(path)}".`, {
|
|
29
29
|
path,
|
package/src/evaluate.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSONPath } from 'jsonpath-plus';
|
|
2
|
-
import { evaluate as jsonPointerEvaluate } from '@
|
|
2
|
+
import { evaluate as jsonPointerEvaluate } from '@swagger-api/apidom-json-pointer/modern';
|
|
3
3
|
import { toValue, cloneDeep } from '@swagger-api/apidom-core';
|
|
4
4
|
import EvaluationJsonPathError from "./errors/EvaluationJsonPathError.mjs";
|
|
5
5
|
/**
|