forked from loafle/openapi-generator-original
* Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator * Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin * Fixed generating retrofit2 without Rx/Coroutines * Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation * Fix documentation diff. * Fix generating build.gradle file for samples. Add dependencies for rxJava/rxJava2 and rx retrofit's adapter. * Update generated sample with rx dependencies * Update generated sample with coroutines * Update generated sample with RxJava 2 dependencies * Update and refactoring scripts for sample generation * Update generated sample code * revert changes by mistake * revert changes by mistake #2 * Fix return type for first RxJava * Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2 * Fix script loggin * Update generated code for RxJava 1/2 * Fix kotlin.md documentation by script export_docs_generators.sh * Update Kotlin samples project in pom.xml * Revert "Update Kotlin samples project in pom.xml" This reverts commit 9de4d0ba * Fixed "" wrapping number types for annotation value Fixed generating polymorphic interfaces for Gson, interface fields can't be marked with @SerializedName annotation, it's enough to mark it in child model. Fixed instantiationTypes(array, list, map) for Kotlin generator * Update Kotlin samples project after last fixes * Update Kotlin samples project for kotlin-jvm-* * Update Kotlin readme.md documentations * Update Kotlin client sample changes * Fixed encoding braces for generics model * Update Kotlin client sample changes * Update Kotlin client sample after merge with master * Fixed adding empty braces for inherit from Map/Array * Update sample model after last fix with empty braces * Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson * Update Kotlin client samples with adding @get:SerializedName
9.7 KiB
9.7 KiB
org.openapitools.client - Kotlin client library for OpenAPI Petstore
Requires
- Kotlin 1.3.50
Build
./gradlew check assemble
This runs all tests and packages the library.
Features/Implementation Notes
- Supports JSON inputs/outputs, File inputs, and Form inputs.
- Supports collection formats for query parameters: csv, tsv, ssv, pipes.
- Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io:80/v2
Class | Method | HTTP request | Description |
---|---|---|---|
AnotherFakeApi | call123testSpecialTags | PATCH /another-fake/dummy | To test special tags |
DefaultApi | fooGet | GET /foo | |
FakeApi | fakeHealthGet | GET /fake/health | Health check endpoint |
FakeApi | fakeHttpSignatureTest | GET /fake/http-signature-test | test http signature authentication |
FakeApi | fakeOuterBooleanSerialize | POST /fake/outer/boolean | |
FakeApi | fakeOuterCompositeSerialize | POST /fake/outer/composite | |
FakeApi | fakeOuterNumberSerialize | POST /fake/outer/number | |
FakeApi | fakeOuterStringSerialize | POST /fake/outer/string | |
FakeApi | testBodyWithFileSchema | PUT /fake/body-with-file-schema | |
FakeApi | testBodyWithQueryParams | PUT /fake/body-with-query-params | |
FakeApi | testClientModel | PATCH /fake | To test "client" model |
FakeApi | testEndpointParameters | POST /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 |
FakeApi | testEnumParameters | GET /fake | To test enum parameters |
FakeApi | testGroupParameters | DELETE /fake | Fake endpoint to test group parameters (optional) |
FakeApi | testInlineAdditionalProperties | POST /fake/inline-additionalProperties | test inline additionalProperties |
FakeApi | testJsonFormData | GET /fake/jsonFormData | test json serialization of form data |
FakeApi | testQueryParameterCollectionFormat | PUT /fake/test-query-paramters | |
FakeClassnameTags123Api | testClassname | PATCH /fake_classname_test | To test class name in snake case |
PetApi | addPet | POST /pet | Add a new pet to the store |
PetApi | deletePet | DELETE /pet/{petId} | Deletes a pet |
PetApi | findPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
PetApi | findPetsByTags | GET /pet/findByTags | Finds Pets by tags |
PetApi | getPetById | GET /pet/{petId} | Find pet by ID |
PetApi | updatePet | PUT /pet | Update an existing pet |
PetApi | updatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
PetApi | uploadFile | POST /pet/{petId}/uploadImage | uploads an image |
PetApi | uploadFileWithRequiredFile | POST /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
StoreApi | deleteOrder | DELETE /store/order/{order_id} | Delete purchase order by ID |
StoreApi | getInventory | GET /store/inventory | Returns pet inventories by status |
StoreApi | getOrderById | GET /store/order/{order_id} | Find purchase order by ID |
StoreApi | placeOrder | POST /store/order | Place an order for a pet |
UserApi | createUser | POST /user | Create user |
UserApi | createUsersWithArrayInput | POST /user/createWithArray | Creates list of users with given input array |
UserApi | createUsersWithListInput | POST /user/createWithList | Creates list of users with given input array |
UserApi | deleteUser | DELETE /user/{username} | Delete user |
UserApi | getUserByName | GET /user/{username} | Get user by user name |
UserApi | loginUser | GET /user/login | Logs user into the system |
UserApi | logoutUser | GET /user/logout | Logs out current logged in user session |
UserApi | updateUser | PUT /user/{username} | Updated user |
Documentation for Models
- org.openapitools.client.models.AdditionalPropertiesClass
- org.openapitools.client.models.Animal
- org.openapitools.client.models.ApiResponse
- org.openapitools.client.models.ArrayOfArrayOfNumberOnly
- org.openapitools.client.models.ArrayOfNumberOnly
- org.openapitools.client.models.ArrayTest
- org.openapitools.client.models.Capitalization
- org.openapitools.client.models.Cat
- org.openapitools.client.models.CatAllOf
- org.openapitools.client.models.Category
- org.openapitools.client.models.ClassModel
- org.openapitools.client.models.Client
- org.openapitools.client.models.Dog
- org.openapitools.client.models.DogAllOf
- org.openapitools.client.models.EnumArrays
- org.openapitools.client.models.EnumClass
- org.openapitools.client.models.EnumTest
- org.openapitools.client.models.FileSchemaTestClass
- org.openapitools.client.models.Foo
- org.openapitools.client.models.FormatTest
- org.openapitools.client.models.HasOnlyReadOnly
- org.openapitools.client.models.HealthCheckResult
- org.openapitools.client.models.InlineObject
- org.openapitools.client.models.InlineObject1
- org.openapitools.client.models.InlineObject2
- org.openapitools.client.models.InlineObject3
- org.openapitools.client.models.InlineObject4
- org.openapitools.client.models.InlineObject5
- org.openapitools.client.models.InlineResponseDefault
- org.openapitools.client.models.List
- org.openapitools.client.models.MapTest
- org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass
- org.openapitools.client.models.Model200Response
- org.openapitools.client.models.Name
- org.openapitools.client.models.NullableClass
- org.openapitools.client.models.NumberOnly
- org.openapitools.client.models.Order
- org.openapitools.client.models.OuterComposite
- org.openapitools.client.models.OuterEnum
- org.openapitools.client.models.OuterEnumDefaultValue
- org.openapitools.client.models.OuterEnumInteger
- org.openapitools.client.models.OuterEnumIntegerDefaultValue
- org.openapitools.client.models.Pet
- org.openapitools.client.models.ReadOnlyFirst
- org.openapitools.client.models.Return
- org.openapitools.client.models.SpecialModelname
- org.openapitools.client.models.Tag
- org.openapitools.client.models.User
Documentation for Authorization
api_key
- Type: API key
- API key parameter name: api_key
- Location: HTTP header
api_key_query
- Type: API key
- API key parameter name: api_key_query
- Location: URL query string
bearer_test
- Type: HTTP basic authentication
http_basic_test
- Type: HTTP basic authentication
http_signature_test
- Type: HTTP basic authentication
petstore_auth
- Type: OAuth
- Flow: implicit
- Authorization URL: http://petstore.swagger.io/api/oauth/dialog
- Scopes:
- write:pets: modify pets in your account
- read:pets: read your pets