From 1e9ef6955b03e7c594c73c2478ad7134eef4ab04 Mon Sep 17 00:00:00 2001 From: aashikam Date: Wed, 6 Mar 2024 20:39:25 +0530 Subject: [PATCH] Update docs --- README.md | 21 +++++++++++++++++++++ ballerina/Module.md | 21 +++++++++++++++++++++ ballerina/Package.md | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/README.md b/README.md index 0645dce..a1595f8 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,31 @@ export JAVA_OPTS="$JAVA_OPTS -DmaxYamlCodePoints=99999999" Generate the Ballerina project for the OpenAPI spec using the Ballerina Open API tool with the following commands. +1. Create a new Ballerina project, naming the project as desired (e.g., custom_types, salesforce_types, etc.). + +```bash +bal new custom_types +``` + +2. Customize the package details by editing the `Ballerina.toml` file. For instance, you can modify the [package] section as follows: + +```toml +[package] +org = "example" +name = "salesforce.types" +version = "0.1.0" +``` + +Feel free to replace "salesforce.types" with one of the suitable desired names like "custom.types" or "integration.types," or come up with your own unique package name. + +4. Move the OpenAPI spec into the newly created project directory and execute the following command: + ```bash bal openapi -i oas.json --mode client --client-methods resource ``` +This will generate the Ballerina project structure, record types that correspond to the SObject definitions, and client methods based on the provided OpenAPI specification. + ### Step 4: Edit the Generated Client and Push it to Local Repository #### Step 4.1 Delete the utils.bal and clients.bal files. diff --git a/ballerina/Module.md b/ballerina/Module.md index 3389c56..165439f 100644 --- a/ballerina/Module.md +++ b/ballerina/Module.md @@ -43,10 +43,31 @@ export JAVA_OPTS="$JAVA_OPTS -DmaxYamlCodePoints=99999999" Generate the Ballerina project for the OpenAPI spec using the Ballerina Open API tool with the following commands. +1. Create a new Ballerina project, naming the project as desired (e.g., custom_types, salesforce_types, etc.). + +```bash +bal new custom_types +``` + +2. Customize the package details by editing the `Ballerina.toml` file. For instance, you can modify the [package] section as follows: + +```toml +[package] +org = "example" +name = "salesforce.types" +version = "0.1.0" +``` + +Feel free to replace "salesforce.types" with one of the suitable desired names like "custom.types" or "integration.types," or come up with your own unique package name. + +4. Move the OpenAPI spec into the newly created project directory and execute the following command: + ```bash bal openapi -i oas.json --mode client --client-methods resource ``` +This will generate the Ballerina project structure, record types that correspond to the SObject definitions, and client methods based on the provided OpenAPI specification. + ### Step 4: Edit the Generated Client and Push it to Local Repository #### Step 4.1 Delete the utils.bal and clients.bal files. diff --git a/ballerina/Package.md b/ballerina/Package.md index 3389c56..165439f 100644 --- a/ballerina/Package.md +++ b/ballerina/Package.md @@ -43,10 +43,31 @@ export JAVA_OPTS="$JAVA_OPTS -DmaxYamlCodePoints=99999999" Generate the Ballerina project for the OpenAPI spec using the Ballerina Open API tool with the following commands. +1. Create a new Ballerina project, naming the project as desired (e.g., custom_types, salesforce_types, etc.). + +```bash +bal new custom_types +``` + +2. Customize the package details by editing the `Ballerina.toml` file. For instance, you can modify the [package] section as follows: + +```toml +[package] +org = "example" +name = "salesforce.types" +version = "0.1.0" +``` + +Feel free to replace "salesforce.types" with one of the suitable desired names like "custom.types" or "integration.types," or come up with your own unique package name. + +4. Move the OpenAPI spec into the newly created project directory and execute the following command: + ```bash bal openapi -i oas.json --mode client --client-methods resource ``` +This will generate the Ballerina project structure, record types that correspond to the SObject definitions, and client methods based on the provided OpenAPI specification. + ### Step 4: Edit the Generated Client and Push it to Local Repository #### Step 4.1 Delete the utils.bal and clients.bal files.