Skip to content

Commit

Permalink
docs(congen): update examples (#2314)
Browse files Browse the repository at this point in the history
* docs(congen): update examples

* Update README.md

* Update postman generator doc

* Update openapi doc
  • Loading branch information
chillleader authored Apr 15, 2024
1 parent 973a548 commit 1a5b606
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions element-template-generator/congen-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
It can be bundled with generators via Java Service Loader mechanism. Generators must be available in the classpath
and implement the `io.camunda.connector.generator.api.CliCompatibleTemplateGenerator` interface.

`congen` comes pre-bundled with [OpenAPI template generator](../openapi-parser).
`congen` comes pre-bundled with [OpenAPI template generator](../openapi-parser) and [Postman collections template generator](../postman-collections-parser).

## Installation

Expand Down Expand Up @@ -43,7 +43,7 @@ Run `congen -h` to see the usage information and a list of available parameters.
The following command will invoke the generator named `openapi-outbound` and pass the specified OpenAPI specification.

```shell
congen generate openapi-outbound https://petstore3.swagger.io/api/v3/openapi.json
congen openapi-outbound generate https://petstore3.swagger.io/api/v3/openapi.json
```

Note that `congen` will pass all parameters specified after the command name to the generator implementation.
Expand All @@ -53,22 +53,22 @@ followed by an optional list of operation IDs to include in the generated templa
The following command will ask the generator to include only the `placeOrder` operation.

```shell
congen generate openapi-outbound https://petstore3.swagger.io/api/v3/openapi.json placeOrder
congen openapi-outbound generate https://petstore3.swagger.io/api/v3/openapi.json placeOrder
```

Note that not all operations in the OpenAPI specification can be converted to a template. The generator will
ignore operations that cannot be converted. To see the list of operations that can be converted, use the `scan` command.

```shell
congen scan openapi-outbound https://petstore3.swagger.io/api/v3/openapi.json
congen openapi-outbound scan https://petstore3.swagger.io/api/v3/openapi.json
```

```shell

The command below will generate the template with the custom element template ID.

```shell
congen --id my-element-template generate openapi-outbound https://petstore3.swagger.io/api/v3/openapi.json
congen --id my-element-template openapi-outbound generate https://petstore3.swagger.io/api/v3/openapi.json
```

Refer to the [OpenAPI generator documentation](../openapi-parser/README.md) for more information on
Expand All @@ -79,26 +79,26 @@ how to use it.
The following command will invoke the generator named `postman-collections-outbound` and pass the specified Postman Collections v.2.1.0 specification:

```shell
congen generate postman-collections-outbound https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
congen postman-collections-outbound generate https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
```

The following command will ask the generator to include only the `/Process instances/Search for process instances` operation.

```shell
congen generate postman-collections-outbound https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json "/Process instances/Search for process instances"
congen postman-collections-outbound generate https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json "/Process instances/Search for process instances"
```

Note that not all operations in the Postman Collections specification can be converted to a template. The generator will
ignore operations that cannot be converted. To see the list of operations that can be converted, use the `scan` command.

```shell
congen scan postman-collections-outbound https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
congen postman-collections-outbound scan https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
```

The command below will generate the template with the custom element template ID.

```shell
congen --id my-element-template generate postman-collections-outbound https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
congen --id my-element-template postman-collections-outbound generate https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
```

Refer to the [Postman Collections generator documentation](../postman-collections-parser/README.md) for more information on
Expand Down
6 changes: 3 additions & 3 deletions element-template-generator/openapi-parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ followed by an optional list of operation IDs to include in the generated templa
The following command will ask the generator to include only the `listPets` operation.

```shell
congen generate openapi-outbound https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json listPets
congen openapi-outbound generate https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json listPets
```

Use the options provided by `congen` to customize the generated template.
For example, the following command will generate the template with the custom element template ID.

```shell
congen --id my-element-template generate openapi-outbound https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json
congen --id my-element-template openapi-outbound generate https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json
```

Refer to the [congen documentation](../congen-cli/README.md) for more information on the available options.
Expand All @@ -34,7 +34,7 @@ Note that this is not a standard option of `congen` and is only supported by the
Add it after all other inputs.

```shell
congen generate openapi-outbound https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json --raw-body
congen openapi-outbound generate https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json --raw-body
```

## Known limitations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ followed by an optional list of operation paths to include in the generated temp
The following command will ask the generator to include only the `/Process instances/Search for process instances` operation.

```shell
congen generate postman-collections-outbound https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json "/Process instances/Search for process instances"
congen postman-collections-outbound generate https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json "/Process instances/Search for process instances"
```

Use the options provided by `congen` to customize the generated template.
For example, the following command will generate the template with the custom element template ID.

```shell
congen --id my-element-template generate postman-collections-outbound https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
congen --id my-element-template postman-collections-outbound generate https://raw.githubusercontent.com/camunda-community-hub/camunda-8-api-postman-collection/main/Operate%20Public%20API%20-%20SaaS.postman_collection.json
```

Or load collection directly from Postman:

```shell
congen generate postman-collections-outbound "https://api.postman.com/collections/<collection id>?access_key=<your access key>"
congen postman-collections-outbound generate "https://api.postman.com/collections/<collection id>?access_key=<your access key>"
```

Refer to the [congen documentation](../congen-cli/README.md) for more information on the available options.
Expand Down

0 comments on commit 1a5b606

Please sign in to comment.