mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 01:27:04 +00:00
Fix response body in Java native client (#14222)
* fix response body in java native client * add new files * update samples
This commit is contained in:
@@ -74,22 +74,21 @@ Please follow the [installation](#installation) instruction and execute the foll
|
||||
|
||||
import org.openapitools.client.*;
|
||||
import org.openapitools.client.model.*;
|
||||
import org.openapitools.client.api.PathApi;
|
||||
import org.openapitools.client.api.BodyApi;
|
||||
|
||||
public class PathApiExample {
|
||||
public class BodyApiExample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
// Configure clients using the `defaultClient` object, such as
|
||||
// overriding the host and port, timeout, etc.
|
||||
PathApi apiInstance = new PathApi(defaultClient);
|
||||
String pathString = "pathString_example"; // String |
|
||||
Integer pathInteger = 56; // Integer |
|
||||
BodyApi apiInstance = new BodyApi(defaultClient);
|
||||
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
String result = apiInstance.testsPathStringPathStringIntegerPathInteger(pathString, pathInteger);
|
||||
Pet result = apiInstance.testEchoBodyPet(pet);
|
||||
System.out.println(result);
|
||||
} catch (ApiException e) {
|
||||
System.err.println("Exception when calling PathApi#testsPathStringPathStringIntegerPathInteger");
|
||||
System.err.println("Exception when calling BodyApi#testEchoBodyPet");
|
||||
System.err.println("Status code: " + e.getCode());
|
||||
System.err.println("Reason: " + e.getResponseBody());
|
||||
System.err.println("Response headers: " + e.getResponseHeaders());
|
||||
@@ -106,6 +105,8 @@ All URIs are relative to *http://localhost:3000*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*BodyApi* | [**testEchoBodyPetWithHttpInfo**](docs/BodyApi.md#testEchoBodyPetWithHttpInfo) | **POST** /echo/body/Pet | Test body parameter(s)
|
||||
*PathApi* | [**testsPathStringPathStringIntegerPathInteger**](docs/PathApi.md#testsPathStringPathStringIntegerPathInteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s)
|
||||
*PathApi* | [**testsPathStringPathStringIntegerPathIntegerWithHttpInfo**](docs/PathApi.md#testsPathStringPathStringIntegerPathIntegerWithHttpInfo) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path parameter(s)
|
||||
*QueryApi* | [**testQueryIntegerBooleanString**](docs/QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s)
|
||||
|
||||
Reference in New Issue
Block a user