Skip to content

Commit

Permalink
refactor: make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Souvikns committed Sep 1, 2022
1 parent e997095 commit aa5cf7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 0 additions & 2 deletions API.md
Expand Up @@ -72,8 +72,6 @@ console.log(document.string()); // get json string
| files | <code>Array.&lt;string&gt;</code> \| <code>Array.&lt;Object&gt;</code> | files that are to be bundled |
| options | <code>Object</code> | |
| options.base | <code>string</code> \| <code>object</code> | base object whose prperties will be retained. |
| options.parser | <code>Object</code> | asyncapi parser object |
| options.validate | <code>boolean</code> | pass false to not validate file before merge |
| options.referenceIntoComponents | <code>boolean</code> | pass true value to resolve references into component |

**Example**
Expand Down
19 changes: 9 additions & 10 deletions README.md
Expand Up @@ -11,6 +11,7 @@
- [Overview](#overview)
- [Installation](#installation)
- [Usage](#usage)
* [Resolving external references into components](#resolving-external-references-into-components)
- [bundle(files, options)](#bundlefiles-options)

<!-- tocstop -->
Expand All @@ -24,7 +25,7 @@ An official library that lets you bundle/merge your specification files into one
```yaml

# asyncapi.yaml
asyncapi: '2.2.0'
asyncapi: '2.4.0'
info:
title: Account Service
version: 1.0.0
Expand All @@ -50,7 +51,7 @@ messages:
description: Email of the user

# After combining
asyncapi: 2.2.0
asyncapi: 2.4.0
info:
title: Account Service
version: 1.0.0
Expand Down Expand Up @@ -80,7 +81,7 @@ channels:
```yaml

# signup.yaml
asyncapi: '2.2.0'
asyncapi: '2.4.0'
info:
title: Account Service
version: 1.0.0
Expand All @@ -101,7 +102,7 @@ channels:


# login.yaml
asyncapi: '2.2.0'
asyncapi: '2.4.0'
info:
title: Account Service
version: 1.0.0
Expand All @@ -119,7 +120,7 @@ channels:

# After combining
# asyncapi.yaml
asyncapi: '2.2.0'
asyncapi: '2.4.0'
info:
title: Account Service
version: 1.0.0
Expand Down Expand Up @@ -178,16 +179,14 @@ console.log(document.json()); // the complete bundled asyncapi document.
```

### Resolving external references into components
**Experimental**

This is a experimental feature, for now you can resolve external references in messages under `compoents/messages`
For now you can resolve external references in messages under `compoents/messages`.

<details>
<summary>For Example</summary>

```yml
# asyncapi.yaml
asyncapi: '2.2.0'
asyncapi: '2.4.0'
info:
title: Account Service
version: 1.0.0
Expand All @@ -213,7 +212,7 @@ messages:
description: Email of the user

# After combining
asyncapi: 2.2.0
asyncapi: 2.4.0
info:
title: Account Service
version: 1.0.0
Expand Down

0 comments on commit aa5cf7a

Please sign in to comment.