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:
William Cheng
2022-12-08 17:29:53 +08:00
committed by GitHub
parent b8b25e8ae0
commit 1fad61e2f8
25 changed files with 767 additions and 72 deletions

View File

@@ -75,22 +75,21 @@ Please follow the [installation](#installation) instruction and execute the foll
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
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();
defaultClient.setBasePath("http://localhost:3000");
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());
@@ -107,6 +106,7 @@ 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)
*PathApi* | [**testsPathStringPathStringIntegerPathInteger**](docs/PathApi.md#testsPathStringPathStringIntegerPathInteger) | **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)
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)