mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 07:26:10 +00:00
Use inline allof instead of $ref in echo test (#14429)
* use inline allof instead of $ref in echo test * update samples * update samples * fix tests
This commit is contained in:
@@ -27,8 +27,8 @@ src/main/java/org/openapitools/client/auth/HttpBasicAuth.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/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/Pet.java
|
||||
src/main/java/org/openapitools/client/model/Tag.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.java
|
||||
src/main/java/org/openapitools/client/model/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.java
|
||||
|
||||
@@ -157,7 +157,7 @@ paths:
|
||||
name: query_object
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/components/schemas/BirdAndCategory'
|
||||
$ref: '#/components/schemas/test_query_style_deepObject_explode_true_object_allOf_query_object_parameter'
|
||||
style: deepObject
|
||||
responses:
|
||||
"200":
|
||||
@@ -285,10 +285,6 @@ components:
|
||||
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:
|
||||
properties:
|
||||
values:
|
||||
@@ -296,4 +292,8 @@ components:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
test_query_style_deepObject_explode_true_object_allOf_query_object_parameter:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/Bird'
|
||||
- $ref: '#/components/schemas/Category'
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import org.openapitools.client.ApiClient;
|
||||
import org.openapitools.client.EncodingUtils;
|
||||
import org.openapitools.client.model.ApiResponse;
|
||||
|
||||
import org.openapitools.client.model.BirdAndCategory;
|
||||
import org.openapitools.client.model.Pet;
|
||||
import org.openapitools.client.model.TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter;
|
||||
import org.openapitools.client.model.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -198,7 +198,7 @@ public interface QueryApi extends ApiClient.Api {
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
String testQueryStyleDeepObjectExplodeTrueObjectAllOf(@Param("queryObject") BirdAndCategory queryObject);
|
||||
String testQueryStyleDeepObjectExplodeTrueObjectAllOf(@Param("queryObject") TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject);
|
||||
|
||||
/**
|
||||
* Test query parameter(s)
|
||||
@@ -211,7 +211,7 @@ public interface QueryApi extends ApiClient.Api {
|
||||
@Headers({
|
||||
"Accept: text/plain",
|
||||
})
|
||||
ApiResponse<String> testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(@Param("queryObject") BirdAndCategory queryObject);
|
||||
ApiResponse<String> testQueryStyleDeepObjectExplodeTrueObjectAllOfWithHttpInfo(@Param("queryObject") TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter queryObject);
|
||||
|
||||
|
||||
/**
|
||||
@@ -259,7 +259,7 @@ public interface QueryApi extends ApiClient.Api {
|
||||
* <code>testQueryStyleDeepObjectExplodeTrueObjectAllOf</code> method in a fluent style.
|
||||
*/
|
||||
public static class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams extends HashMap<String, Object> {
|
||||
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams queryObject(final BirdAndCategory value) {
|
||||
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryParams queryObject(final TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter value) {
|
||||
put("query_object", EncodingUtils.encode(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {
|
||||
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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() {
|
||||
}
|
||||
|
||||
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter 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;
|
||||
}
|
||||
TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter = (TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter) o;
|
||||
return Objects.equals(this.size, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.size) &&
|
||||
Objects.equals(this.color, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.color) &&
|
||||
Objects.equals(this.id, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.id) &&
|
||||
Objects.equals(this.name, testQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(size, color, id, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {\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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTest {
|
||||
private final TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter model = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter();
|
||||
|
||||
/**
|
||||
* Model tests for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
*/
|
||||
@Test
|
||||
void testTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() {
|
||||
// TODO: test TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user