openapi-generator-original/samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization
Daniil Iastremskii e86daf9059
Add support for oneOf with discriminator when using kotlinx.serialization (#22373)
* Generate wrappers for oneOf with discriminator when using kotlinx.serialization

* Add spec with oneOf using discriminator

* Add config to generate samples

* Generate samples

* Update samples

* Change naming of wrapper classes

* Fix empty model test

* Update GH workflow with new samples
2025-11-19 02:55:37 +08:00
..

org.openapitools.client - Kotlin client library for Example

An example

Overview

This API client was generated by the OpenAPI Generator project. By using the openapi-spec from a remote server, you can easily generate an API client.

  • API version: 0.1
  • Package version:
  • Generator version: 7.18.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.KotlinClientCodegen For more information, please visit https://example.org

Requires

  • Kotlin 2.2.20
  • Gradle 8.14

Build

First, create the gradle wrapper script:

gradle wrapper

Then, run:

./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.
  • Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.

Documentation for API Endpoints

All URIs are relative to http://example.org

Class Method HTTP request Description
BirdApi getBird GET v1/bird/{id}

Documentation for Models

Documentation for Authorization

Endpoints do not require authorization.

Author

contact@example.org