Fix missing import in allOf query parameters (#14408)

* add test for allOf in query parameter

* fix missing import in allof query parameter

* update samples

* update samples
This commit is contained in:
William Cheng 2023-01-11 20:29:13 +08:00 committed by GitHub
parent 3f96cdb756
commit 50e295e3c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 2479 additions and 1 deletions

View File

@ -5031,7 +5031,7 @@ public class DefaultCodegen implements CodegenConfig {
if (parameterModelName != null) { if (parameterModelName != null) {
codegenParameter.dataType = parameterModelName; codegenParameter.dataType = parameterModelName;
if (ModelUtils.isObjectSchema(parameterSchema)) { if (ModelUtils.isObjectSchema(parameterSchema) || ModelUtils.isComposedSchema(parameterSchema)) {
codegenProperty.complexType = codegenParameter.dataType; codegenProperty.complexType = codegenParameter.dataType;
} }
} else { } else {

View File

@ -158,6 +158,27 @@ paths:
text/plain: text/plain:
schema: schema:
type: string type: string
/query/style_deepObject/explode_true/object/allOf:
get:
tags:
- query
summary: Test query parameter(s)
description: Test query parameter(s)
operationId: test/query/style_deepObject/explode_true/object/allOf
parameters:
- in: query
name: query_object
style: deepObject
explode: true #default
schema:
$ref: '#/components/schemas/BirdAndCategory'
responses:
'200':
description: Successful operation
content:
text/plain:
schema:
type: string
/echo/body/Pet: /echo/body/Pet:
post: post:
tags: tags:
@ -244,3 +265,14 @@ components:
- sold - sold
xml: xml:
name: pet name: pet
Bird:
type: object
properties:
size:
type: string
color:
type: string
BirdAndCategory:
allOf:
- $ref: '#/components/schemas/Bird'
- $ref: '#/components/schemas/Category'

View File

@ -5,6 +5,8 @@ README.md
api/openapi.yaml api/openapi.yaml
build.gradle build.gradle
build.sbt build.sbt
docs/Bird.md
docs/BirdAndCategory.md
docs/BodyApi.md docs/BodyApi.md
docs/Category.md docs/Category.md
docs/PathApi.md docs/PathApi.md
@ -37,6 +39,8 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
src/main/java/org/openapitools/client/auth/Authentication.java src/main/java/org/openapitools/client/auth/Authentication.java
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
src/main/java/org/openapitools/client/model/Bird.java
src/main/java/org/openapitools/client/model/BirdAndCategory.java
src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/Category.java
src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/Tag.java

View File

@ -110,12 +110,15 @@ Class | Method | HTTP request | Description
*PathApi* | [**testsPathStringPathStringIntegerPathInteger**](docs/PathApi.md#testsPathStringPathStringIntegerPathInteger) | **GET** /path/string/{path_string}/integer/{path_integer} | Test path 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* | [**testQueryIntegerBooleanString**](docs/QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s)
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) *QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) *QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) *QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
## Documentation for Models ## Documentation for Models
- [Bird](docs/Bird.md)
- [BirdAndCategory](docs/BirdAndCategory.md)
- [Category](docs/Category.md) - [Category](docs/Category.md)
- [Pet](docs/Pet.md) - [Pet](docs/Pet.md)
- [Tag](docs/Tag.md) - [Tag](docs/Tag.md)

View File

@ -147,6 +147,29 @@ paths:
tags: tags:
- query - query
x-accepts: text/plain x-accepts: text/plain
/query/style_deepObject/explode_true/object/allOf:
get:
description: Test query parameter(s)
operationId: test/query/style_deepObject/explode_true/object/allOf
parameters:
- explode: true
in: query
name: query_object
required: false
schema:
$ref: '#/components/schemas/BirdAndCategory'
style: deepObject
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test query parameter(s)
tags:
- query
x-accepts: text/plain
/echo/body/Pet: /echo/body/Pet:
post: post:
description: Test body parameter(s) description: Test body parameter(s)
@ -255,6 +278,17 @@ components:
type: object type: object
xml: xml:
name: pet name: pet
Bird:
properties:
size:
type: string
color:
type: string
type: object
BirdAndCategory:
allOf:
- $ref: '#/components/schemas/Bird'
- $ref: '#/components/schemas/Category'
test_query_style_form_explode_true_array_string_query_object_parameter: test_query_style_form_explode_true_array_string_query_object_parameter:
properties: properties:
values: values:

View File

@ -0,0 +1,14 @@
# Bird
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**size** | **String** | | [optional] |
|**color** | **String** | | [optional] |

View File

@ -0,0 +1,16 @@
# BirdAndCategory
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**size** | **String** | | [optional] |
|**color** | **String** | | [optional] |
|**id** | **Long** | | [optional] |
|**name** | **String** | | [optional] |

View File

@ -6,6 +6,7 @@ All URIs are relative to *http://localhost:3000*
|------------- | ------------- | -------------| |------------- | ------------- | -------------|
| [**testQueryIntegerBooleanString**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) | | [**testQueryIntegerBooleanString**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) |
| [**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) | | [**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) |
| [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
| [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) | | [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
| [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) | | [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
@ -147,6 +148,72 @@ No authorization required
| **200** | Successful operation | - | | **200** | Successful operation | - |
## testQueryStyleDeepObjectExplodeTrueObjectAllOf
> String testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject)
Test query parameter(s)
Test query parameter(s)
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.QueryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
QueryApi apiInstance = new QueryApi(defaultClient);
BirdAndCategory queryObject = new BirdAndCategory(); // BirdAndCategory |
try {
String result = apiInstance.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling QueryApi#testQueryStyleDeepObjectExplodeTrueObjectAllOf");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **queryObject** | [**BirdAndCategory**](.md)| | [optional] |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testQueryStyleFormExplodeTrueArrayString ## testQueryStyleFormExplodeTrueArrayString
> String testQueryStyleFormExplodeTrueArrayString(queryObject) > String testQueryStyleFormExplodeTrueArrayString(queryObject)

View File

@ -20,6 +20,7 @@ import org.openapitools.client.Configuration;
import org.openapitools.client.model.*; import org.openapitools.client.model.*;
import org.openapitools.client.Pair; import org.openapitools.client.Pair;
import org.openapitools.client.model.BirdAndCategory;
import org.openapitools.client.model.Pet; import org.openapitools.client.model.Pet;
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
@ -134,6 +135,61 @@ public class QueryApi {
final String[] localVarAccepts = {
"text/plain"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { };
TypeReference<String> localVarReturnType = new TypeReference<String>() {};
return apiClient.invokeAPI(
localVarPath,
"GET",
localVarQueryParams,
localVarCollectionQueryParams,
localVarQueryDeepObjectStringJoiner.toString(),
localVarPostBody,
localVarHeaderParams,
localVarCookieParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType
);
}
/**
* Test query parameter(s)
* Test query parameter(s)
* @param queryObject (optional)
* @return String
* @throws ApiException if fails to make API call
*/
public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(BirdAndCategory queryObject) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/query/style_deepObject/explode_true/object/allOf";
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
List<Pair> localVarQueryParams = new ArrayList<Pair>();
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, String> localVarCookieParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
localVarQueryParameterBaseName = "query_object";
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
final String[] localVarAccepts = { final String[] localVarAccepts = {
"text/plain" "text/plain"
}; };

View File

@ -0,0 +1,161 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
/**
* Bird
*/
@JsonPropertyOrder({
Bird.JSON_PROPERTY_SIZE,
Bird.JSON_PROPERTY_COLOR
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Bird {
public static final String JSON_PROPERTY_SIZE = "size";
private String size;
public static final String JSON_PROPERTY_COLOR = "color";
private String color;
public Bird() {
}
public Bird size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSize(String size) {
this.size = size;
}
public Bird color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Bird bird = (Bird) o;
return Objects.equals(this.size, bird.size) &&
Objects.equals(this.color, bird.color);
}
@Override
public int hashCode() {
return Objects.hash(size, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Bird {\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
if (prefix == null) {
prefix = "";
}
StringJoiner joiner = new StringJoiner("&");
// add `size` to the URL query string
if (getSize() != null) {
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `color` to the URL query string
if (getColor() != null) {
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}

View File

@ -0,0 +1,233 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
/**
* BirdAndCategory
*/
@JsonPropertyOrder({
BirdAndCategory.JSON_PROPERTY_SIZE,
BirdAndCategory.JSON_PROPERTY_COLOR,
BirdAndCategory.JSON_PROPERTY_ID,
BirdAndCategory.JSON_PROPERTY_NAME
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class BirdAndCategory {
public static final String JSON_PROPERTY_SIZE = "size";
private String size;
public static final String JSON_PROPERTY_COLOR = "color";
private String color;
public static final String JSON_PROPERTY_ID = "id";
private Long id;
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public BirdAndCategory() {
}
public BirdAndCategory size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSize(String size) {
this.size = size;
}
public BirdAndCategory color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColor(String color) {
this.color = color;
}
public BirdAndCategory id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(Long id) {
this.id = id;
}
public BirdAndCategory name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BirdAndCategory birdAndCategory = (BirdAndCategory) o;
return Objects.equals(this.size, birdAndCategory.size) &&
Objects.equals(this.color, birdAndCategory.color) &&
Objects.equals(this.id, birdAndCategory.id) &&
Objects.equals(this.name, birdAndCategory.name);
}
@Override
public int hashCode() {
return Objects.hash(size, color, id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BirdAndCategory {\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
if (prefix == null) {
prefix = "";
}
StringJoiner joiner = new StringJoiner("&");
// add `size` to the URL query string
if (getSize() != null) {
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `color` to the URL query string
if (getColor() != null) {
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `id` to the URL query string
if (getId() != null) {
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `name` to the URL query string
if (getName() != null) {
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}

View File

@ -0,0 +1,72 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for BirdAndCategory
*/
public class BirdAndCategoryTest {
private final BirdAndCategory model = new BirdAndCategory();
/**
* Model tests for BirdAndCategory
*/
@Test
public void testBirdAndCategory() {
// TODO: test BirdAndCategory
}
/**
* Test the property 'size'
*/
@Test
public void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
/**
* Test the property 'id'
*/
@Test
public void idTest() {
// TODO: test id
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@ -0,0 +1,56 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for Bird
*/
public class BirdTest {
private final Bird model = new Bird();
/**
* Model tests for Bird
*/
@Test
public void testBird() {
// TODO: test Bird
}
/**
* Test the property 'size'
*/
@Test
public void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
}

View File

@ -26,6 +26,8 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java
src/main/java/org/openapitools/client/model/ApiResponse.java src/main/java/org/openapitools/client/model/ApiResponse.java
src/main/java/org/openapitools/client/model/Bird.java
src/main/java/org/openapitools/client/model/BirdAndCategory.java
src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/Category.java
src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/Tag.java

View File

@ -147,6 +147,29 @@ paths:
tags: tags:
- query - query
x-accepts: text/plain x-accepts: text/plain
/query/style_deepObject/explode_true/object/allOf:
get:
description: Test query parameter(s)
operationId: test/query/style_deepObject/explode_true/object/allOf
parameters:
- explode: true
in: query
name: query_object
required: false
schema:
$ref: '#/components/schemas/BirdAndCategory'
style: deepObject
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test query parameter(s)
tags:
- query
x-accepts: text/plain
/echo/body/Pet: /echo/body/Pet:
post: post:
description: Test body parameter(s) description: Test body parameter(s)
@ -255,6 +278,17 @@ components:
type: object type: object
xml: xml:
name: pet name: pet
Bird:
properties:
size:
type: string
color:
type: string
type: object
BirdAndCategory:
allOf:
- $ref: '#/components/schemas/Bird'
- $ref: '#/components/schemas/Category'
test_query_style_form_explode_true_array_string_query_object_parameter: test_query_style_form_explode_true_array_string_query_object_parameter:
properties: properties:
values: values:

View File

@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.EncodingUtils; import org.openapitools.client.EncodingUtils;
import org.openapitools.client.model.ApiResponse; import org.openapitools.client.model.ApiResponse;
import org.openapitools.client.model.BirdAndCategory;
import org.openapitools.client.model.Pet; import org.openapitools.client.model.Pet;
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
@ -187,6 +188,83 @@ public interface QueryApi extends ApiClient.Api {
} }
} }
/**
* Test query parameter(s)
* Test query parameter(s)
* @param queryObject (optional)
* @return String
*/
@RequestLine("GET /query/style_deepObject/explode_true/object/allOf?query_object={queryObject}")
@Headers({
"Accept: text/plain",
})
String testQueryStyleDeepObjectExplodeTrueObjectAllOf(@Param("queryObject") BirdAndCategory queryObject);
/**
* Test query parameter(s)
* Similar to <code>testQueryStyleDeepObjectExplodeTrueObjectAllOf</code> but it also returns the http response headers .
* Test query parameter(s)
* @param queryObject (optional)
* @return A ApiResponse that wraps the response boyd and the http headers.
*/
@RequestLine("GET /query/style_deepObject/explode_true/object/allOf?query_object={queryObject}")
@Headers({
"Accept: text/plain",
})
ApiResponse<String> testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(@Param("queryObject") BirdAndCategory queryObject);
/**
* Test query parameter(s)
* Test query parameter(s)
* Note, this is equivalent to the other <code>testQueryStyleDeepObjectExplodeTrueObjectAllOf</code> method,
* but with the query parameters collected into a single Map parameter. This
* is convenient for services with optional query parameters, especially when
* used with the {@link TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams} class that allows for
* building up this map in a fluent style.
* @param queryParams Map of query parameters as name-value pairs
* <p>The following elements may be specified in the query map:</p>
* <ul>
* <li>queryObject - (optional)</li>
* </ul>
* @return String
*/
@RequestLine("GET /query/style_deepObject/explode_true/object/allOf?query_object={queryObject}")
@Headers({
"Accept: text/plain",
})
String testQueryStyleDeepObjectExplodeTrueObjectAllOf(@QueryMap(encoded=true) TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams queryParams);
/**
* Test query parameter(s)
* Test query parameter(s)
* Note, this is equivalent to the other <code>testQueryStyleDeepObjectExplodeTrueObjectAllOf</code> that receives the query parameters as a map,
* but this one also exposes the Http response headers
* @param queryParams Map of query parameters as name-value pairs
* <p>The following elements may be specified in the query map:</p>
* <ul>
* <li>queryObject - (optional)</li>
* </ul>
* @return String
*/
@RequestLine("GET /query/style_deepObject/explode_true/object/allOf?query_object={queryObject}")
@Headers({
"Accept: text/plain",
})
ApiResponse<String> testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(@QueryMap(encoded=true) TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams queryParams);
/**
* A convenience class for generating query parameters for the
* <code>testQueryStyleDeepObjectExplodeTrueObjectAllOf</code> method in a fluent style.
*/
public static class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams extends HashMap<String, Object> {
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams queryObject(final BirdAndCategory value) {
put("query_object", EncodingUtils.encode(value));
return this;
}
}
/** /**
* Test query parameter(s) * Test query parameter(s)
* Test query parameter(s) * Test query parameter(s)

View File

@ -0,0 +1,125 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* Bird
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Bird {
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private String size;
public static final String SERIALIZED_NAME_COLOR = "color";
@SerializedName(SERIALIZED_NAME_COLOR)
private String color;
public Bird() {
}
public Bird size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public Bird color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Bird bird = (Bird) o;
return Objects.equals(this.size, bird.size) &&
Objects.equals(this.color, bird.color);
}
@Override
public int hashCode() {
return Objects.hash(size, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Bird {\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,181 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
/**
* BirdAndCategory
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class BirdAndCategory {
public static final String SERIALIZED_NAME_SIZE = "size";
@SerializedName(SERIALIZED_NAME_SIZE)
private String size;
public static final String SERIALIZED_NAME_COLOR = "color";
@SerializedName(SERIALIZED_NAME_COLOR)
private String color;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private Long id;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public BirdAndCategory() {
}
public BirdAndCategory size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public BirdAndCategory color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public BirdAndCategory id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public BirdAndCategory name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BirdAndCategory birdAndCategory = (BirdAndCategory) o;
return Objects.equals(this.size, birdAndCategory.size) &&
Objects.equals(this.color, birdAndCategory.color) &&
Objects.equals(this.id, birdAndCategory.id) &&
Objects.equals(this.name, birdAndCategory.name);
}
@Override
public int hashCode() {
return Objects.hash(size, color, id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BirdAndCategory {\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -0,0 +1,71 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import org.junit.jupiter.api.Test;
/**
* Model tests for BirdAndCategory
*/
class BirdAndCategoryTest {
private final BirdAndCategory model = new BirdAndCategory();
/**
* Model tests for BirdAndCategory
*/
@Test
void testBirdAndCategory() {
// TODO: test BirdAndCategory
}
/**
* Test the property 'size'
*/
@Test
void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
void colorTest() {
// TODO: test color
}
/**
* Test the property 'id'
*/
@Test
void idTest() {
// TODO: test id
}
/**
* Test the property 'name'
*/
@Test
void nameTest() {
// TODO: test name
}
}

View File

@ -0,0 +1,55 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import org.junit.jupiter.api.Test;
/**
* Model tests for Bird
*/
class BirdTest {
private final Bird model = new Bird();
/**
* Model tests for Bird
*/
@Test
void testBird() {
// TODO: test Bird
}
/**
* Test the property 'size'
*/
@Test
void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
void colorTest() {
// TODO: test color
}
}

View File

@ -5,6 +5,8 @@ README.md
api/openapi.yaml api/openapi.yaml
build.gradle build.gradle
build.sbt build.sbt
docs/Bird.md
docs/BirdAndCategory.md
docs/BodyApi.md docs/BodyApi.md
docs/Category.md docs/Category.md
docs/PathApi.md docs/PathApi.md
@ -34,6 +36,8 @@ src/main/java/org/openapitools/client/api/BodyApi.java
src/main/java/org/openapitools/client/api/PathApi.java src/main/java/org/openapitools/client/api/PathApi.java
src/main/java/org/openapitools/client/api/QueryApi.java src/main/java/org/openapitools/client/api/QueryApi.java
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java
src/main/java/org/openapitools/client/model/Bird.java
src/main/java/org/openapitools/client/model/BirdAndCategory.java
src/main/java/org/openapitools/client/model/Category.java src/main/java/org/openapitools/client/model/Category.java
src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pet.java
src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/Tag.java

View File

@ -113,6 +113,8 @@ Class | Method | HTTP request | Description
*QueryApi* | [**testQueryIntegerBooleanStringWithHttpInfo**](docs/QueryApi.md#testQueryIntegerBooleanStringWithHttpInfo) | **GET** /query/integer/boolean/string | Test query parameter(s) *QueryApi* | [**testQueryIntegerBooleanStringWithHttpInfo**](docs/QueryApi.md#testQueryIntegerBooleanStringWithHttpInfo) | **GET** /query/integer/boolean/string | Test query parameter(s)
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) *QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) *QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s)
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo**](docs/QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s)
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) *QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
*QueryApi* | [**testQueryStyleFormExplodeTrueArrayStringWithHttpInfo**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayStringWithHttpInfo) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) *QueryApi* | [**testQueryStyleFormExplodeTrueArrayStringWithHttpInfo**](docs/QueryApi.md#testQueryStyleFormExplodeTrueArrayStringWithHttpInfo) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s)
*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) *QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s)
@ -121,6 +123,8 @@ Class | Method | HTTP request | Description
## Documentation for Models ## Documentation for Models
- [Bird](docs/Bird.md)
- [BirdAndCategory](docs/BirdAndCategory.md)
- [Category](docs/Category.md) - [Category](docs/Category.md)
- [Pet](docs/Pet.md) - [Pet](docs/Pet.md)
- [Tag](docs/Tag.md) - [Tag](docs/Tag.md)

View File

@ -147,6 +147,29 @@ paths:
tags: tags:
- query - query
x-accepts: text/plain x-accepts: text/plain
/query/style_deepObject/explode_true/object/allOf:
get:
description: Test query parameter(s)
operationId: test/query/style_deepObject/explode_true/object/allOf
parameters:
- explode: true
in: query
name: query_object
required: false
schema:
$ref: '#/components/schemas/BirdAndCategory'
style: deepObject
responses:
"200":
content:
text/plain:
schema:
type: string
description: Successful operation
summary: Test query parameter(s)
tags:
- query
x-accepts: text/plain
/echo/body/Pet: /echo/body/Pet:
post: post:
description: Test body parameter(s) description: Test body parameter(s)
@ -255,6 +278,17 @@ components:
type: object type: object
xml: xml:
name: pet name: pet
Bird:
properties:
size:
type: string
color:
type: string
type: object
BirdAndCategory:
allOf:
- $ref: '#/components/schemas/Bird'
- $ref: '#/components/schemas/Category'
test_query_style_form_explode_true_array_string_query_object_parameter: test_query_style_form_explode_true_array_string_query_object_parameter:
properties: properties:
values: values:

View File

@ -0,0 +1,14 @@
# Bird
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**size** | **String** | | [optional] |
|**color** | **String** | | [optional] |

View File

@ -0,0 +1,16 @@
# BirdAndCategory
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**size** | **String** | | [optional] |
|**color** | **String** | | [optional] |
|**id** | **Long** | | [optional] |
|**name** | **String** | | [optional] |

View File

@ -8,6 +8,8 @@ All URIs are relative to *http://localhost:3000*
| [**testQueryIntegerBooleanStringWithHttpInfo**](QueryApi.md#testQueryIntegerBooleanStringWithHttpInfo) | **GET** /query/integer/boolean/string | Test query parameter(s) | | [**testQueryIntegerBooleanStringWithHttpInfo**](QueryApi.md#testQueryIntegerBooleanStringWithHttpInfo) | **GET** /query/integer/boolean/string | Test query parameter(s) |
| [**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) | | [**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) |
| [**testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) | | [**testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) |
| [**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
| [**testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) |
| [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) | | [**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
| [**testQueryStyleFormExplodeTrueArrayStringWithHttpInfo**](QueryApi.md#testQueryStyleFormExplodeTrueArrayStringWithHttpInfo) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) | | [**testQueryStyleFormExplodeTrueArrayStringWithHttpInfo**](QueryApi.md#testQueryStyleFormExplodeTrueArrayStringWithHttpInfo) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) |
| [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) | | [**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) |
@ -291,6 +293,140 @@ No authorization required
| **200** | Successful operation | - | | **200** | Successful operation | - |
## testQueryStyleDeepObjectExplodeTrueObjectAllOf
> String testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject)
Test query parameter(s)
Test query parameter(s)
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.QueryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
QueryApi apiInstance = new QueryApi(defaultClient);
BirdAndCategory queryObject = new BirdAndCategory(); // BirdAndCategory |
try {
String result = apiInstance.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling QueryApi#testQueryStyleDeepObjectExplodeTrueObjectAllOf");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **queryObject** | [**BirdAndCategory**](.md)| | [optional] |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo
> ApiResponse<String> testQueryStyleDeepObjectExplodeTrueObjectAllOf testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(queryObject)
Test query parameter(s)
Test query parameter(s)
### Example
```java
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.models.*;
import org.openapitools.client.api.QueryApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:3000");
QueryApi apiInstance = new QueryApi(defaultClient);
BirdAndCategory queryObject = new BirdAndCategory(); // BirdAndCategory |
try {
ApiResponse<String> response = apiInstance.testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(queryObject);
System.out.println("Status code: " + response.getStatusCode());
System.out.println("Response headers: " + response.getHeaders());
System.out.println("Response body: " + response.getData());
} catch (ApiException e) {
System.err.println("Exception when calling QueryApi#testQueryStyleDeepObjectExplodeTrueObjectAllOf");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
System.err.println("Reason: " + e.getResponseBody());
e.printStackTrace();
}
}
}
```
### Parameters
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **queryObject** | [**BirdAndCategory**](.md)| | [optional] |
### Return type
ApiResponse<**String**>
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful operation | - |
## testQueryStyleFormExplodeTrueArrayString ## testQueryStyleFormExplodeTrueArrayString
> String testQueryStyleFormExplodeTrueArrayString(queryObject) > String testQueryStyleFormExplodeTrueArrayString(queryObject)

View File

@ -0,0 +1,16 @@
# TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
## Properties
| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**id** | **Long** | | [optional] |
|**name** | **String** | | [optional] |
|**size** | **String** | | [optional] |
|**color** | **String** | | [optional] |

View File

@ -17,6 +17,7 @@ import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse; import org.openapitools.client.ApiResponse;
import org.openapitools.client.Pair; import org.openapitools.client.Pair;
import org.openapitools.client.model.BirdAndCategory;
import org.openapitools.client.model.Pet; import org.openapitools.client.model.Pet;
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter; import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
@ -265,6 +266,98 @@ public class QueryApi {
} }
return localVarRequestBuilder; return localVarRequestBuilder;
} }
/**
* Test query parameter(s)
* Test query parameter(s)
* @param queryObject (optional)
* @return String
* @throws ApiException if fails to make API call
*/
public String testQueryStyleDeepObjectExplodeTrueObjectAllOf(BirdAndCategory queryObject) throws ApiException {
ApiResponse<String> localVarResponse = testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(queryObject);
return localVarResponse.getData();
}
/**
* Test query parameter(s)
* Test query parameter(s)
* @param queryObject (optional)
* @return ApiResponse&lt;String&gt;
* @throws ApiException if fails to make API call
*/
public ApiResponse<String> testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(BirdAndCategory queryObject) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = testQueryStyleDeepObjectExplodeTrueObjectAllOfRequestBuilder(queryObject);
try {
HttpResponse<InputStream> localVarResponse = memberVarHttpClient.send(
localVarRequestBuilder.build(),
HttpResponse.BodyHandlers.ofInputStream());
if (memberVarResponseInterceptor != null) {
memberVarResponseInterceptor.accept(localVarResponse);
}
try {
if (localVarResponse.statusCode()/ 100 != 2) {
throw getApiException("testQueryStyleDeepObjectExplodeTrueObjectAllOf", localVarResponse);
}
// for plain text response
if (localVarResponse.headers().map().containsKey("Content-Type") &&
"text/plain".equalsIgnoreCase(localVarResponse.headers().map().get("Content-Type").get(0))) {
java.util.Scanner s = new java.util.Scanner(localVarResponse.body()).useDelimiter("\\A");
String responseBodyText = s.hasNext() ? s.next() : "";
return new ApiResponse<String>(
localVarResponse.statusCode(),
localVarResponse.headers().map(),
responseBodyText
);
} else {
throw new RuntimeException("Error! The response Content-Type is supposed to be `text/plain` but it's not: " + localVarResponse);
}
} finally {
}
} catch (IOException e) {
throw new ApiException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ApiException(e);
}
}
private HttpRequest.Builder testQueryStyleDeepObjectExplodeTrueObjectAllOfRequestBuilder(BirdAndCategory queryObject) throws ApiException {
HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();
String localVarPath = "/query/style_deepObject/explode_true/object/allOf";
List<Pair> localVarQueryParams = new ArrayList<>();
StringJoiner localVarQueryDeepObjectStringJoiner = new StringJoiner("&");
String localVarQueryParameterBaseName;
localVarQueryParameterBaseName = "query_object";
if (queryObject != null) {
localVarQueryDeepObjectStringJoiner.add(queryObject.toUrlQueryString("query_object"));
}
if (!localVarQueryParams.isEmpty() || localVarQueryDeepObjectStringJoiner.length() != 0) {
StringJoiner queryJoiner = new StringJoiner("&");
localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue()));
if (localVarQueryDeepObjectStringJoiner.length() != 0) {
queryJoiner.add(localVarQueryDeepObjectStringJoiner.toString());
}
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString()));
} else {
localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));
}
localVarRequestBuilder.header("Accept", "text/plain");
localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody());
if (memberVarReadTimeout != null) {
localVarRequestBuilder.timeout(memberVarReadTimeout);
}
if (memberVarInterceptor != null) {
memberVarInterceptor.accept(localVarRequestBuilder);
}
return localVarRequestBuilder;
}
/** /**
* Test query parameter(s) * Test query parameter(s)
* Test query parameter(s) * Test query parameter(s)

View File

@ -0,0 +1,168 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import java.util.StringJoiner;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* Bird
*/
@JsonPropertyOrder({
Bird.JSON_PROPERTY_SIZE,
Bird.JSON_PROPERTY_COLOR
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Bird {
public static final String JSON_PROPERTY_SIZE = "size";
private String size;
public static final String JSON_PROPERTY_COLOR = "color";
private String color;
public Bird() {
}
public Bird size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSize(String size) {
this.size = size;
}
public Bird color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColor(String color) {
this.color = color;
}
/**
* Return true if this Bird object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Bird bird = (Bird) o;
return Objects.equals(this.size, bird.size) &&
Objects.equals(this.color, bird.color);
}
@Override
public int hashCode() {
return Objects.hash(size, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Bird {\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
if (prefix == null) {
prefix = "";
}
StringJoiner joiner = new StringJoiner("&");
// add `size` to the URL query string
if (getSize() != null) {
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `color` to the URL query string
if (getColor() != null) {
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}

View File

@ -0,0 +1,240 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import java.util.StringJoiner;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* BirdAndCategory
*/
@JsonPropertyOrder({
BirdAndCategory.JSON_PROPERTY_SIZE,
BirdAndCategory.JSON_PROPERTY_COLOR,
BirdAndCategory.JSON_PROPERTY_ID,
BirdAndCategory.JSON_PROPERTY_NAME
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class BirdAndCategory {
public static final String JSON_PROPERTY_SIZE = "size";
private String size;
public static final String JSON_PROPERTY_COLOR = "color";
private String color;
public static final String JSON_PROPERTY_ID = "id";
private Long id;
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public BirdAndCategory() {
}
public BirdAndCategory size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSize(String size) {
this.size = size;
}
public BirdAndCategory color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColor(String color) {
this.color = color;
}
public BirdAndCategory id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(Long id) {
this.id = id;
}
public BirdAndCategory name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
/**
* Return true if this BirdAndCategory object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BirdAndCategory birdAndCategory = (BirdAndCategory) o;
return Objects.equals(this.size, birdAndCategory.size) &&
Objects.equals(this.color, birdAndCategory.color) &&
Objects.equals(this.id, birdAndCategory.id) &&
Objects.equals(this.name, birdAndCategory.name);
}
@Override
public int hashCode() {
return Objects.hash(size, color, id, name);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BirdAndCategory {\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
if (prefix == null) {
prefix = "";
}
StringJoiner joiner = new StringJoiner("&");
// add `size` to the URL query string
if (getSize() != null) {
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `color` to the URL query string
if (getColor() != null) {
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `id` to the URL query string
if (getId() != null) {
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `name` to the URL query string
if (getName() != null) {
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}

View File

@ -0,0 +1,240 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import java.util.StringJoiner;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
@JsonPropertyOrder({
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_ID,
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_NAME,
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_SIZE,
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.JSON_PROPERTY_COLOR
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {
public static final String JSON_PROPERTY_ID = "id";
private Long id;
public static final String JSON_PROPERTY_NAME = "name";
private String name;
public static final String JSON_PROPERTY_SIZE = "size";
private String size;
public static final String JSON_PROPERTY_COLOR = "color";
private String color;
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() {
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(Long id) {
this.id = id;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) {
this.name = name;
return this;
}
/**
* Get name
* @return name
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getName() {
return name;
}
@JsonProperty(JSON_PROPERTY_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setName(String name) {
this.name = name;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter size(String size) {
this.size = size;
return this;
}
/**
* Get size
* @return size
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getSize() {
return size;
}
@JsonProperty(JSON_PROPERTY_SIZE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setSize(String size) {
this.size = size;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) {
this.color = color;
return this;
}
/**
* Get color
* @return color
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getColor() {
return color;
}
@JsonProperty(JSON_PROPERTY_COLOR)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColor(String color) {
this.color = color;
}
/**
* Return true if this test_query_style_deepObject_explode_true_object_allOf_query_object_parameter object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter = (TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter) o;
return Objects.equals(this.id, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.id) &&
Objects.equals(this.name, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.name) &&
Objects.equals(this.size, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.size) &&
Objects.equals(this.color, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.color);
}
@Override
public int hashCode() {
return Objects.hash(id, name, size, color);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" size: ").append(toIndentedString(size)).append("\n");
sb.append(" color: ").append(toIndentedString(color)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
if (prefix == null) {
prefix = "";
}
StringJoiner joiner = new StringJoiner("&");
// add `id` to the URL query string
if (getId() != null) {
joiner.add(String.format("%s[id]=%s", prefix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `name` to the URL query string
if (getName() != null) {
joiner.add(String.format("%s[name]=%s", prefix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `size` to the URL query string
if (getSize() != null) {
joiner.add(String.format("%s[size]=%s", prefix, URLEncoder.encode(String.valueOf(getSize()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
// add `color` to the URL query string
if (getColor() != null) {
joiner.add(String.format("%s[color]=%s", prefix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20")));
}
return joiner.toString();
}
}

View File

@ -90,6 +90,25 @@ public class CustomTest {
Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path); Assert.assertEquals("/query/style_deepObject/explode_true/object?query_object[id]=12345&query_object[name]=Hello%20World&query_object[category][id]=987&query_object[category][name]=new%20category&query_object[photoUrls][0]=http%3A%2F%2Fa.com&query_object[photoUrls][1]=http%3A%2F%2Fb.com", p.path);
} }
/**
* Test query parameter(s)
* <p>
* Test query parameter(s)
*
* @throws ApiException if the Api call fails
*/
@Test
public void testQueryStyleDeepObjectExplodeTrueObjectAllOf() throws ApiException {
BirdAndCategory queryObject = new BirdAndCategory().id(12345L).name("Hello World").
color("red").size("small");
Assert.assertEquals("query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", queryObject.toUrlQueryString("query_object"));
String response = api.testQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
org.openapitools.client.EchoServerResponseParser p = new org.openapitools.client.EchoServerResponseParser(response);
Assert.assertEquals("/query/style_deepObject/explode_true/object/allOf?query_object[size]=small&query_object[color]=red&query_object[id]=12345&query_object[name]=Hello%20World", p.path);
}
/** /**
* Test query parameter(s) * Test query parameter(s)
* <p> * <p>

View File

@ -0,0 +1,72 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for BirdAndCategory
*/
public class BirdAndCategoryTest {
private final BirdAndCategory model = new BirdAndCategory();
/**
* Model tests for BirdAndCategory
*/
@Test
public void testBirdAndCategory() {
// TODO: test BirdAndCategory
}
/**
* Test the property 'size'
*/
@Test
public void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
/**
* Test the property 'id'
*/
@Test
public void idTest() {
// TODO: test id
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
}

View File

@ -0,0 +1,56 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for Bird
*/
public class BirdTest {
private final Bird model = new Bird();
/**
* Model tests for Bird
*/
@Test
public void testBird() {
// TODO: test Bird
}
/**
* Test the property 'size'
*/
@Test
public void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
}

View File

@ -0,0 +1,72 @@
/*
* Echo Server API
* Echo Server API
*
* The version of the OpenAPI document: 0.1.0
* Contact: team@openapitools.org
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
/**
* Model tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest {
private final TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter model = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter();
/**
* Model tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
*/
@Test
public void testTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() {
// TODO: test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
}
/**
* Test the property 'id'
*/
@Test
public void idTest() {
// TODO: test id
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
/**
* Test the property 'size'
*/
@Test
public void sizeTest() {
// TODO: test size
}
/**
* Test the property 'color'
*/
@Test
public void colorTest() {
// TODO: test color
}
}