open-index/open-npm huggingface dataset:
npm package: @swagger-api/apidom-json-path
Description: Evaluate JSONPath expressions against ApiDOM.
Author: Vladimír Gorej
Latest version: 1.10.1

# @swagger-api/apidom-json-path

`apidom-json-path` is a package that evaluates [JSONPath](https://support.smartbear.com/alertsite/docs/monitors/api/endpoint/jsonpath.html) expressions against ApiDOM.

## Installation

You can install this package via [npm CLI](https://docs.npmjs.com/cli) by running the following command:

```sh
 $ npm install @swagger-api/apidom-json-path
```

## Evaluating

Package contains JSONPath evaluation functions for evaluating single or multiple JSONPath expression.

### Evaluating single JSONPath expression

Suited for evaluating single JSONPath expression against ApiDOM.

```js
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluate } from '@swagger-api/apidom-json-path';

const apidom = new ObjectElement({
  a: {
    b: [100, 1, 2],
  },
});
const result = evaluate('$.a.b[?(@ < 10)]', apidom);
// =>
// [
//   NumberElement(1),
//   NumberElement(2),
// ]
```
### Evaluating multiple JSONPath expressions

Suited for evaluating multiple JSONPath expression against the same ApiDOM.
Use this function in cases when you have multiple JSONPath expressions that need
to be evaluated against single ApiDOM fragment.

```js
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluateMulti } from '@swagger-api/apidom-json-path';

const apidom = new ObjectElement({
  a: {
    b: [100, 1, 2],
  },
});
const resultMulti = evaluateMulti(['$.a.b[?(@ < 10)]', '$.a.b[?(@ > 10)]'], apidom);
// => returns list of tuples which represents mappings between paths and end point values
// [
//   ['$.a.b[?(@ < 10)]', [NumberElement(1), NumberElement(2)]],
//   ['$.a.b[?(@ > 10)]', [NUmberElement(100)]],
// ]
```

## Invalid JSONPath expression

If either `evaluate` or `evaluateMulti` functions are provided with invalid JSONPath expressions,
they don't throw errors, but they rather return empty list of end point values.

```js
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluate, evaluateMulti } from '@swagger-api/apidom-json-path';

const apidom = new ObjectElement({
  a: {
    b: [100, 1, 2],
  },
});
const result = evaluate('%~!@U@IU$@', apidom); // => []
const resultMulti = evaluateMulti(['%~!@U@IU$@', 'd*AS&*)(&YR3R'], apidom); // => []
```
npm package: @swagger-api/apidom-json-pointer-relative
Description: Evaluate Relative JSON Pointer expressions against ApiDOM.
Author: Vladimír Gorej
Latest version: 1.10.1

# @swagger-api/apidom-json-pointer-relative

`apidom-json-pointer-relative` is a package that evaluates [Relative JSON Pointer](https://datatracker.ietf.org/doc/html/draft-bhutton-relative-json-pointer-00) against ApiDOM.

## Installation

You can install this package via [npm CLI](https://docs.npmjs.com/cli) by running the following command:

```sh
 $ npm install @swagger-api/apidom-json-pointer-relative
```
## Evaluating

```js
import { ObjectElement } from '@swagger-api/apidom-core';
import { evaluate } from '@swagger-api/apidom-json-pointer-relative';

const root = new ObjectElement({ a: { b: 'c' } });
const current = root.get('a').get('b');
const result =  evaluate('0#', current, root);
// => StringElement('b')
```

## Parsing

Parses Relative JSON Pointer into AST (Abstract Syntax Tree).

```js
import { parse } from '@swagger-api/apidom-json-pointer-relative';

const tokens = parse('2/foo/0');
// => { nonNegativeIntegerPrefix: 2, indexManipulation: undefined, jsonPointerTokens: ['foo', '0'], hashCharacter: false }
```

## Compiling

Compiles AST into Relative JSON Pointer.

```js
import { compile } from '@swagger-api/apidom-json-pointer-relative';

const relativeJsonPointer = compile({
  nonNegativeIntegerPrefix: 2,
  indexManipulation: undefined,
  jsonPointerTokens: ['highly', 'nested', 'objects'],
  hashCharacter: false,
}); // => '2/highly/nested/objects'
```

## Invalid Relative JSON Pointers

If invalid Relative JSON Pointer is supplied to `parse` or `evaluate` functions, `InvalidRelativeJsonPointerError`
is thrown.

```js
import { InvalidRelativeJsonPointerError } from '@swagger-api/apidom-json-pointer-relative';
```

If valid JSON Pointer is supplied to `evaluate` function and the relative pointer cannot be evaluated against
ApiDOM fragment, `EvaluationRelativeJsonPointerError` is thrown.

```js
import { EvaluationRelativeJsonPointerError } from '@swagger-api/apidom-json-pointer-relative';
```
npm package: @swagger-api/apidom-ns-asyncapi-3
Description: AsyncAPI 3.x.y namespace for ApiDOM.
Author: apidom team
Latest version: 1.10.1

# apidom-ns-asyncapi-3

AsyncAPI 3.x.y namespace for ApiDOM.

This is a starter scaffold. Implement element classes, predicates and refractor visitors following the pattern from `apidom-ns-asyncapi-2`.