Skip to content

Commit

Permalink
Merge branch 'main' into support-schema-title-as-ref
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethaasan committed Mar 21, 2024
2 parents 3fe6c13 + 617ccff commit d00d6c9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 27 deletions.
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -47,7 +47,7 @@ npm install # or npm i

To compile the code, run `npm run compile`. To do that on the fly, run `npm run watch` in a separate thread.

To run a specific CLI command, use `npm run cli`, e.g. `npm run cli -- lint resources/museum.yaml --format=stylish`. Please notice that the extra `--` is required to pass arguments to the CLI rather than the NPM itself.
To run a specific CLI command, use `npm run cli`, e.g. `npm run cli -- lint resources/museum.yaml --format=stylish`. Please notice that the extra `--` is required to pass arguments to the CLI rather than to NPM itself.

Format your code with `npm run prettier` before committing.

Expand All @@ -57,6 +57,8 @@ There are some other scripts available in the `scripts` section of the `package.

## Local source code usage

There are two options for testing local changes in other local applications: NPM linking and local packing and installing from the `redocly-cli.tgz` file.

### NPM linking

To test the local source code of the packages in other local applications, you can use npm linking. See the [docs](https://docs.npmjs.com/cli/v9/commands/npm-link).
Expand Down Expand Up @@ -148,6 +150,9 @@ The application maintains the following exit codes.

## Tests

When running tests, make sure the code is compiled (`npm run compile` or `npm run watch`).
Having `redocly.yaml` in the root of the project affects the unit tests, and console logs affect the e2e tests, so make sure to get rid of both before running tests.

### Unit tests

Run unit tests with this command: `npm run test`.
Expand Down Expand Up @@ -212,7 +217,7 @@ After merging a PR with a changeset, the release PR is automatically created.

If the pipelines are not starting, close and reopen the PR. Merging that PR triggers the release process.

## Revert a release
### Revert a release

There's no possibility to revert a release itself.
However, you can release a new version with a problematic commit reverted.
Expand Down
34 changes: 9 additions & 25 deletions docs/commands/join.md
Expand Up @@ -60,24 +60,20 @@ Use the [lint command](./lint.md) separately to lint your APIs before joining.

### Array of paths

{% tabs %}
{% tab label="Command" %}
**Command**

```bash
redocly join first-api.yaml second-api.json
```

{% /tab %}
{% tab label="Output" %}
**Output**

```bash
redocly join first-api.yaml second-api.json

openapi.yaml: join processed in 56ms
```

{% /tab %}
{% /tabs %}
The command creates the output `openapi.yaml` file in the working directory.

The order of input files affects how their content is processed. The first provided file is always treated as the "main" file, and its content has precedence over other input files when combining them. Specifically, the following properties of the API description are always taken only from the first input file:
Expand Down Expand Up @@ -152,15 +148,13 @@ The output file preserves the original tag names as the value of the `x-displayN

#### Usage

{% tabs %}
{% tab label="Command" %}
**Command**

```bash
redocly join first-api.yaml second-api.json --prefix-tags-with-info-prop title
```

{% /tab %}
{% tab label="Output file example" %}
**Output file example**

```yaml
- name: First Document title_endpoints
Expand All @@ -172,9 +166,6 @@ redocly join first-api.yaml second-api.json --prefix-tags-with-info-prop title
x-displayName: events
```

{% /tab %}
{% /tabs %}

### prefix-tags-with-filename

If any of the input files contain the `tags` object, tags in the output file are prefixed by the filename of the corresponding input file.
Expand All @@ -183,15 +174,13 @@ The output file preserves the original tag names as the value of the `x-displayN

#### Usage

{% tabs %}
{% tab label="Command" %}
**Command**

```bash
redocly join first-api.yaml second-api.json --prefix-tags-with-filename true
```

{% /tab %}
{% tab label="Output file example" %}
**Output file example**

```yaml
- name: first-api_endpoints
Expand All @@ -203,9 +192,6 @@ redocly join first-api.yaml second-api.json --prefix-tags-with-filename true
x-displayName: events
```

{% /tab %}
{% /tabs %}

### without-x-tag-groups

If you have the same tags in multiple API descriptions, you can allow tag duplication by using the `without-x-tag-groups` option. In this case, the `x-tagGroups` property is not created in the joined file.
Expand All @@ -230,12 +216,13 @@ If any of the input files have conflicting component names, this option can be u

#### Usage

**Command**

```bash
redocly join museum_v1.yaml museum_v2.json --prefix-components-with-info-prop version
```

{% /tab %}
{% tab label="Output file example" %}
**Output file example**

```yaml
components:
Expand Down Expand Up @@ -287,9 +274,6 @@ components:

```

{% /tab %}
{% /tabs %}

### Custom output file

By default, the CLI tool writes the joined file as `openapi.yaml` or `openapi.json` in the current working directory. Use the optional `--output` argument to provide an alternative output file path.
Expand Down

0 comments on commit d00d6c9

Please sign in to comment.