Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -3200,8 +3200,7 @@ Implements functions to deal with the AsyncAPI document.
<a name="module_@asyncapi/parser+AsyncAPIDocument+traverseSchemas"></a>

#### asyncAPIDocument.traverseSchemas(callback, schemaTypesToIterate)
Traverse schemas in the document and select which types of schemas to include.
By default all schemas are iterated
Traverse schemas in the document and select which types of schemas to include.By default all schemas are iterated
Comment thread
KhudaDad414 marked this conversation as resolved.
Outdated

**Kind**: instance method of [<code>AsyncAPIDocument</code>](#module_@asyncapi/parser+AsyncAPIDocument)

Expand Down Expand Up @@ -3478,10 +3477,10 @@ The complete list of parse configuration options used to parse the given data.

| Name | Type | Description |
| --- | --- | --- |
| path | <code>String</code> | Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir. |
| parse | <code>Object</code> | Options object to pass to [json-schema-ref-parser](https://apidevtools.org/json-schema-ref-parser/docs/options.html). |
| resolve | <code>Object</code> | Options object to pass to [json-schema-ref-parser](https://apidevtools.org/json-schema-ref-parser/docs/options.html). |
| applyTraits | <code>Boolean</code> | Whether to resolve and apply traits or not. Defaults to true. |
| [path] | <code>String</code> | Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir. |
| [parse] | <code>Object</code> | Options object to pass to [json-schema-ref-parser](https://apidevtools.org/json-schema-ref-parser/docs/options.html). |
| [resolve] | <code>Object</code> | Options object to pass to [json-schema-ref-parser](https://apidevtools.org/json-schema-ref-parser/docs/options.html). |
| [applyTraits] | <code>Boolean</code> | Whether to resolve and apply traits or not. Defaults to true. |

<a name="MixinBindings"></a>

Expand Down
8 changes: 4 additions & 4 deletions lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ module.exports = {
/**
* The complete list of parse configuration options used to parse the given data.
* @typedef {Object} ParserOptions
* @property {String} path - Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir.
* @property {Object} parse - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property {Object} resolve - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property {Boolean} applyTraits - Whether to resolve and apply traits or not. Defaults to true.
* @property {String=} path - Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir.
* @property {Object=} parse - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property {Object=} resolve - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property {Boolean=} applyTraits - Whether to resolve and apply traits or not. Defaults to true.
Comment thread
KhudaDad414 marked this conversation as resolved.
*/

/**
Expand Down
16 changes: 8 additions & 8 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,16 +1066,16 @@ declare module "@asyncapi/parser" {
}
/**
* The complete list of parse configuration options used to parse the given data.
* @property path - Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir.
* @property parse - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property resolve - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property applyTraits - Whether to resolve and apply traits or not. Defaults to true.
* @property [path] - Path to the AsyncAPI document. It will be used to resolve relative references. Defaults to current working dir.
* @property [parse] - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property [resolve] - Options object to pass to {@link https://apidevtools.org/json-schema-ref-parser/docs/options.html|json-schema-ref-parser}.
* @property [applyTraits] - Whether to resolve and apply traits or not. Defaults to true.
*/
type ParserOptions = {
path: string;
parse: any;
resolve: any;
applyTraits: boolean;
path?: string;
parse?: any;
resolve?: any;
applyTraits?: boolean;
};
/**
* Parses and validate an AsyncAPI document from YAML or JSON.
Expand Down