Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detailed instructions for running API Dash-generated code in Kotlin using okhttp3 #535

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
40 changes: 39 additions & 1 deletion doc/user_guide/instructions_to_run_generated_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,46 @@ TODO
TODO

## Kotlin (okhttp3)
Here are the detailed instructions for running the generated API Dash code in Kotlin (using okhttp3) for macOS, Windows, and Linux:

### 1. Install Kotlin:
To run Kotlin code, you need to install Kotlin first. You can install Kotlin from the official Kotlin website:

- Go to [Kotlin Installation Guide](https://kotlinlang.org/docs/getting-started.html#install-kotlin) for detailed steps.
- Remember: `Kotlin is included in each IntelliJ IDEA and Android Studio release. Download and install one of these IDEs to start using Kotlin`.

Once Kotlin is installed, proceed with adding `okhttp` and running the generated code.

### 2. Add `okhttp` library:
To use `okhttp3` in your Kotlin project, you need to include it as a dependency. If you're using **Gradle**, follow these steps:

- Open the `build.gradle` file in your project.
- Add the following dependency in the `dependencies` section:

```gradle
implementation("com.squareup.okhttp3:okhttp:4.12.0")
```

- Sync your project to apply the dependency.

### 3. Execute the generated code:
After setting up Kotlin and `okhttp3`, follow these steps to run the generated code:

1. **Open your IDE** ✍️ (like Android Studio).
2. **Create a new Kotlin file** 📝 (or use an existing one).
3. **Copy the generated code** 📋 from API Dash.
4. **Paste the code** into the Kotlin file 🔄.
5. **Run the Kotlin file** by clicking the "Run" button in your IDE or by using the command line.

#### If you're running from the command line:
1. **Navigate to the project directory** using the terminal or command prompt.
2. **Compile and run the Kotlin file** with these commands:

```bash
kotlinc api_test.kt -include-runtime -d api_test.jar
java -jar api_test.jar
```

TODO

## PHP (curl)

Expand Down