forked from loafle/openapi-generator-original
Better handling of Inline schema (#15682)
* skip allOf inline subschema created as $ref * add option for fallback * add back atleastonemodel * add log * update java, kotlin, js samples * update tests * fix native client test * fix java client errors by regenerating test files * clean up python * clean up powershell * clean up php * clean up ruby * update erlang, elixir * update dart samples * update ts samples * update r, go samples * update perl * update swift * add back files * add back files * remove outdated test files * fix test
This commit is contained in:
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* test
|
||||
* test
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ChildSchemaAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ChildSchemaAllOf.JSON_PROPERTY_PROP1
|
||||
})
|
||||
@JsonTypeName("ChildSchema_allOf")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ChildSchemaAllOf {
|
||||
public static final String JSON_PROPERTY_PROP1 = "prop1";
|
||||
private String prop1;
|
||||
|
||||
public ChildSchemaAllOf() {
|
||||
}
|
||||
|
||||
public ChildSchemaAllOf prop1(String prop1) {
|
||||
this.prop1 = prop1;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get prop1
|
||||
* @return prop1
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_PROP1)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getProp1() {
|
||||
return prop1;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_PROP1)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setProp1(String prop1) {
|
||||
this.prop1 = prop1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this ChildSchema_allOf object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ChildSchemaAllOf childSchemaAllOf = (ChildSchemaAllOf) o;
|
||||
return Objects.equals(this.prop1, childSchemaAllOf.prop1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prop1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ChildSchemaAllOf {\n");
|
||||
sb.append(" prop1: ").append(toIndentedString(prop1)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* test
|
||||
* test
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* 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 java.util.Map;
|
||||
import java.util.HashMap;
|
||||
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 org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* MySchemaNameCharactersAllOf
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
MySchemaNameCharactersAllOf.JSON_PROPERTY_PROP2
|
||||
})
|
||||
@JsonTypeName("MySchemaName___Characters_allOf")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class MySchemaNameCharactersAllOf {
|
||||
public static final String JSON_PROPERTY_PROP2 = "prop2";
|
||||
private String prop2;
|
||||
|
||||
public MySchemaNameCharactersAllOf() {
|
||||
}
|
||||
|
||||
public MySchemaNameCharactersAllOf prop2(String prop2) {
|
||||
this.prop2 = prop2;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get prop2
|
||||
* @return prop2
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@JsonProperty(JSON_PROPERTY_PROP2)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getProp2() {
|
||||
return prop2;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_PROP2)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setProp2(String prop2) {
|
||||
this.prop2 = prop2;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this MySchemaName___Characters_allOf object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
MySchemaNameCharactersAllOf mySchemaNameCharactersAllOf = (MySchemaNameCharactersAllOf) o;
|
||||
return Objects.equals(this.prop2, mySchemaNameCharactersAllOf.prop2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(prop2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class MySchemaNameCharactersAllOf {\n");
|
||||
sb.append(" prop2: ").append(toIndentedString(prop2)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* test
|
||||
* test
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* 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.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Model tests for ChildSchemaAllOf
|
||||
*/
|
||||
public class ChildSchemaAllOfTest {
|
||||
private final ChildSchemaAllOf model = new ChildSchemaAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for ChildSchemaAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testChildSchemaAllOf() {
|
||||
// TODO: test ChildSchemaAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'prop1'
|
||||
*/
|
||||
@Test
|
||||
public void prop1Test() {
|
||||
// TODO: test prop1
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.JSON;
|
||||
import org.openapitools.client.model.ChildSchemaAllOf;
|
||||
import org.openapitools.client.model.Parent;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
@@ -40,15 +38,7 @@ public class ChildSchemaTest {
|
||||
*/
|
||||
@Test
|
||||
public void testChildSchema() {
|
||||
String objJson = "{ \"objectType\": \"ChildSchema\", \"prop1\":\"some_value\" }";
|
||||
try {
|
||||
JSON j = new JSON();
|
||||
ChildSchema obj = j.getMapper().readValue(objJson, ChildSchema.class);
|
||||
Assertions.assertEquals(obj.getObjectType(), "ChildSchema");
|
||||
Assertions.assertEquals(obj.getProp1(), "some_value");
|
||||
} catch (Exception ex) {
|
||||
Assertions.fail("Exception '" + ex.getMessage() + "' should not have been raised");
|
||||
}
|
||||
// TODO: test ChildSchema
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* test
|
||||
* test
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
*
|
||||
* 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.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Model tests for MySchemaNameCharactersAllOf
|
||||
*/
|
||||
public class MySchemaNameCharactersAllOfTest {
|
||||
private final MySchemaNameCharactersAllOf model = new MySchemaNameCharactersAllOf();
|
||||
|
||||
/**
|
||||
* Model tests for MySchemaNameCharactersAllOf
|
||||
*/
|
||||
@Test
|
||||
public void testMySchemaNameCharactersAllOf() {
|
||||
// TODO: test MySchemaNameCharactersAllOf
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'prop2'
|
||||
*/
|
||||
@Test
|
||||
public void prop2Test() {
|
||||
// TODO: test prop2
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import org.openapitools.client.JSON;
|
||||
import org.openapitools.client.model.MySchemaNameCharactersAllOf;
|
||||
import org.openapitools.client.model.Parent;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
Reference in New Issue
Block a user