Skip to content

Commit 4f16ba1

Browse files
committed
Generate samples
1 parent f6ba4ea commit 4f16ba1

42 files changed

Lines changed: 1738 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.openapi-generator-ignore
2+
README.md
3+
build.gradle
4+
docs/Animal.md
5+
docs/AnotherAnimal.md
6+
docs/Bird.md
7+
docs/BirdApi.md
8+
docs/Robobird.md
9+
gradle/wrapper/gradle-wrapper.jar
10+
gradle/wrapper/gradle-wrapper.properties
11+
gradlew
12+
gradlew.bat
13+
proguard-rules.pro
14+
settings.gradle
15+
src/main/kotlin/org/openapitools/client/apis/BirdApi.kt
16+
src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
17+
src/main/kotlin/org/openapitools/client/infrastructure/AtomicBooleanAdapter.kt
18+
src/main/kotlin/org/openapitools/client/infrastructure/AtomicIntegerAdapter.kt
19+
src/main/kotlin/org/openapitools/client/infrastructure/AtomicLongAdapter.kt
20+
src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
21+
src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
22+
src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt
23+
src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
24+
src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
25+
src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
26+
src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt
27+
src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt
28+
src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt
29+
src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
30+
src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt
31+
src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
32+
src/main/kotlin/org/openapitools/client/models/Animal.kt
33+
src/main/kotlin/org/openapitools/client/models/AnotherAnimal.kt
34+
src/main/kotlin/org/openapitools/client/models/Bird.kt
35+
src/main/kotlin/org/openapitools/client/models/Robobird.kt
36+
src/test/kotlin/org/openapitools/client/apis/BirdApiTest.kt
37+
src/test/kotlin/org/openapitools/client/models/AnimalTest.kt
38+
src/test/kotlin/org/openapitools/client/models/AnotherAnimalTest.kt
39+
src/test/kotlin/org/openapitools/client/models/BirdTest.kt
40+
src/test/kotlin/org/openapitools/client/models/RobobirdTest.kt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.18.0-SNAPSHOT
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# org.openapitools.client - Kotlin client library for Example
2+
3+
An example
4+
5+
## Overview
6+
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.
7+
8+
- API version: 0.1
9+
- Package version:
10+
- Generator version: 7.18.0-SNAPSHOT
11+
- Build package: org.openapitools.codegen.languages.KotlinClientCodegen
12+
For more information, please visit [https://example.org](https://example.org)
13+
14+
## Requires
15+
16+
* Kotlin 2.2.20
17+
* Gradle 8.14
18+
19+
## Build
20+
21+
First, create the gradle wrapper script:
22+
23+
```
24+
gradle wrapper
25+
```
26+
27+
Then, run:
28+
29+
```
30+
./gradlew check assemble
31+
```
32+
33+
This runs all tests and packages the library.
34+
35+
## Features/Implementation Notes
36+
37+
* Supports JSON inputs/outputs, File inputs, and Form inputs.
38+
* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
39+
* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
40+
* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
41+
42+
<a id="documentation-for-api-endpoints"></a>
43+
## Documentation for API Endpoints
44+
45+
All URIs are relative to *http://example.org*
46+
47+
| Class | Method | HTTP request | Description |
48+
| ------------ | ------------- | ------------- | ------------- |
49+
| *BirdApi* | [**getBird**](docs/BirdApi.md#getbird) | **GET** v1/bird/{id} | |
50+
51+
52+
<a id="documentation-for-models"></a>
53+
## Documentation for Models
54+
55+
- [org.openapitools.client.models.Animal](docs/Animal.md)
56+
- [org.openapitools.client.models.AnotherAnimal](docs/AnotherAnimal.md)
57+
- [org.openapitools.client.models.Bird](docs/Bird.md)
58+
- [org.openapitools.client.models.Robobird](docs/Robobird.md)
59+
60+
61+
<a id="documentation-for-authorization"></a>
62+
## Documentation for Authorization
63+
64+
Endpoints do not require authorization.
65+
66+
67+
68+
## Author
69+
70+
contact@example.org
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
group 'org.openapitools'
2+
version '1.0.0'
3+
4+
wrapper {
5+
gradleVersion = '8.14.3'
6+
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
7+
}
8+
9+
buildscript {
10+
ext.kotlin_version = '2.2.20'
11+
ext.retrofitVersion = '3.0.0'
12+
ext.spotless_version = "7.2.1"
13+
14+
repositories {
15+
maven { url "https://repo1.maven.org/maven2" }
16+
}
17+
dependencies {
18+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19+
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
20+
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
21+
}
22+
}
23+
24+
apply plugin: 'kotlin'
25+
apply plugin: 'kotlinx-serialization'
26+
apply plugin: 'maven-publish'
27+
apply plugin: 'com.diffplug.spotless'
28+
29+
repositories {
30+
maven { url "https://repo1.maven.org/maven2" }
31+
}
32+
33+
// Use spotless plugin to automatically format code, remove unused import, etc
34+
// To apply changes directly to the file, run `gradlew spotlessApply`
35+
// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle
36+
spotless {
37+
// comment out below to run spotless as part of the `check` task
38+
enforceCheck false
39+
40+
format 'misc', {
41+
// define the files (e.g. '*.gradle', '*.md') to apply `misc` to
42+
target '.gitignore'
43+
44+
// define the steps to apply to those files
45+
trimTrailingWhitespace()
46+
indentWithSpaces() // Takes an integer argument if you don't like 4
47+
endWithNewline()
48+
}
49+
kotlin {
50+
ktfmt()
51+
}
52+
}
53+
54+
test {
55+
useJUnitPlatform()
56+
}
57+
58+
dependencies {
59+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
60+
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0"
61+
implementation "com.squareup.okhttp3:logging-interceptor:5.1.0"
62+
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
63+
implementation "com.squareup.retrofit2:converter-kotlinx-serialization:$retrofitVersion"
64+
implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
65+
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
66+
}
67+
68+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
69+
kotlinOptions {
70+
freeCompilerArgs += "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi"
71+
}
72+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# Animal
3+
4+
## Properties
5+
| Name | Type | Description | Notes |
6+
| ------------ | ------------- | ------------- | ------------- |
7+
| **discriminator** | **kotlin.String** | | |
8+
| **anotherDiscriminator** | **kotlin.String** | | |
9+
| **propertyA** | **kotlin.String** | | [optional] |
10+
| **sameNameProperty** | **kotlin.String** | | [optional] |
11+
| **propertyB** | **kotlin.String** | | [optional] |
12+
13+
14+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
# AnotherAnimal
3+
4+
## Properties
5+
| Name | Type | Description | Notes |
6+
| ------------ | ------------- | ------------- | ------------- |
7+
| **discriminator** | **kotlin.String** | | |
8+
| **anotherDiscriminator** | **kotlin.String** | | |
9+
| **propertyA** | **kotlin.String** | | [optional] |
10+
| **sameNameProperty** | **kotlin.String** | | [optional] |
11+
| **propertyB** | **kotlin.String** | | [optional] |
12+
13+
14+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# Bird
3+
4+
## Properties
5+
| Name | Type | Description | Notes |
6+
| ------------ | ------------- | ------------- | ------------- |
7+
| **discriminator** | **kotlin.String** | | |
8+
| **anotherDiscriminator** | **kotlin.String** | | |
9+
| **propertyA** | **kotlin.String** | | [optional] |
10+
| **sameNameProperty** | **kotlin.Int** | | [optional] |
11+
12+
13+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# BirdApi
2+
3+
All URIs are relative to *http://example.org*
4+
5+
| Method | HTTP request | Description |
6+
| ------------- | ------------- | ------------- |
7+
| [**getBird**](BirdApi.md#getBird) | **GET** v1/bird/{id} | |
8+
9+
10+
11+
12+
13+
### Example
14+
```kotlin
15+
// Import classes:
16+
//import org.openapitools.client.*
17+
//import org.openapitools.client.infrastructure.*
18+
//import org.openapitools.client.models.*
19+
20+
val apiClient = ApiClient()
21+
val webService = apiClient.createWebservice(BirdApi::class.java)
22+
val id : java.util.UUID = 38400000-8cf0-11bd-b23e-10b96e4ef00d // java.util.UUID |
23+
24+
val result : Animal = webService.getBird(id)
25+
```
26+
27+
### Parameters
28+
| Name | Type | Description | Notes |
29+
| ------------- | ------------- | ------------- | ------------- |
30+
| **id** | **java.util.UUID**| | |
31+
32+
### Return type
33+
34+
[**Animal**](Animal.md)
35+
36+
### Authorization
37+
38+
No authorization required
39+
40+
### HTTP request headers
41+
42+
- **Content-Type**: Not defined
43+
- **Accept**: application/json
44+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
# Robobird
3+
4+
## Properties
5+
| Name | Type | Description | Notes |
6+
| ------------ | ------------- | ------------- | ------------- |
7+
| **discriminator** | **kotlin.String** | | |
8+
| **anotherDiscriminator** | **kotlin.String** | | |
9+
| **propertyB** | **kotlin.String** | | [optional] |
10+
| **sameNameProperty** | **kotlin.String** | | [optional] |
11+
12+
13+

0 commit comments

Comments
 (0)