Bruno Coelho 9d53ee4b69 [kotlin][client] make Request date converter toJson as default (#4884)
* Fix for Issue #2205

Because when we have tags on OpenAPI Specification, there can be more than 1 Feign Beans being generated and the title field is share by all the clients. This makes the code to stop working in runtime.
Here is a PR which uses the classVarName instead, which follows the standards and should be enough to solve this issue.

For more info please refer to: https://github.com/OpenAPITools/openapi-generator/issues/2205

* fix java feign parameter request name (#4883)

* update sprign cloud feign sample

* [JAVA][SPRING][2195] added missing getter for enum value (#2346)

* [2195] added missing getter for enum value

* updated samples

* re-generate spring samples

* Removed @JsonValue from toString and regenerated samples

* re-generate spring samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>

* update samples

* [kotlin][client] make Request date converter toJson as default

* [kotlin][client] update windows scripts

* [kotlin][client] update docs

* [kotlin][client] update scripts

* [kotlin][client] update scripts

Co-authored-by: Filipe Manuel Couto Pinheiro <filipemcpinheiro@gmail.com>
Co-authored-by: William Cheng <wing328hk@gmail.com>
Co-authored-by: Lukáš Vasek <bilaak@gmail.com>
Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
2020-01-02 13:46:49 +08:00

4.8 KiB

StoreApi

All URIs are relative to http://petstore.swagger.io/v2

Method HTTP request Description
deleteOrder DELETE /store/order/{orderId} Delete purchase order by ID
getInventory GET /store/inventory Returns pet inventories by status
getOrderById GET /store/order/{orderId} Find purchase order by ID
placeOrder POST /store/order Place an order for a pet

deleteOrder

deleteOrder(orderId)

Delete purchase order by ID

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Example

// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*

val apiInstance = StoreApi()
val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted
try {
    apiInstance.deleteOrder(orderId)
} catch (e: ClientException) {
    println("4xx response calling StoreApi#deleteOrder")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling StoreApi#deleteOrder")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
orderId kotlin.String ID of the order that needs to be deleted

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getInventory

kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory()

Returns pet inventories by status

Returns a map of status codes to quantities

Example

// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*

val apiInstance = StoreApi()
try {
    val result : kotlin.collections.Map<kotlin.String, kotlin.Int> = apiInstance.getInventory()
    println(result)
} catch (e: ClientException) {
    println("4xx response calling StoreApi#getInventory")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling StoreApi#getInventory")
    e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

kotlin.collections.Map<kotlin.String, kotlin.Int>

Authorization

Configure api_key: ApiClient.apiKey["api_key"] = "" ApiClient.apiKeyPrefix["api_key"] = ""

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getOrderById

Order getOrderById(orderId)

Find purchase order by ID

For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

Example

// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*

val apiInstance = StoreApi()
val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched
try {
    val result : Order = apiInstance.getOrderById(orderId)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling StoreApi#getOrderById")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling StoreApi#getOrderById")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
orderId kotlin.Long ID of pet that needs to be fetched

Return type

Order

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json

placeOrder

Order placeOrder(body)

Place an order for a pet

Example

// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*

val apiInstance = StoreApi()
val body : Order =  // Order | order placed for purchasing the pet
try {
    val result : Order = apiInstance.placeOrder(body)
    println(result)
} catch (e: ClientException) {
    println("4xx response calling StoreApi#placeOrder")
    e.printStackTrace()
} catch (e: ServerException) {
    println("5xx response calling StoreApi#placeOrder")
    e.printStackTrace()
}

Parameters

Name Type Description Notes
body Order order placed for purchasing the pet

Return type

Order

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml, application/json