forked from loafle/openapi-generator-original
[java][okhttp-gson-nextgen] better oneOf implementation (#11146)
* add validJsonObject method * add check for null * fix list model generation * fix optional fields validation * add tests * fix variable naming * update tests * add fromJson in oneOf, add tests * convert JSON to static * remove trailing space * add fromString methods to all models * add toJson, fix anyOf template * remove workarounds * undo changes to tests * skip file schema test * add new file
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
generatorName: java
|
||||
outputDir: samples/client/petstore/java/okhttp-gson-nextgen
|
||||
library: okhttp-gson-nextgen
|
||||
#inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-okhttp-gson-nextgen
|
||||
|
||||
@@ -50,19 +50,19 @@ import java.util.HashMap;
|
||||
* backward-compatibility
|
||||
*/
|
||||
public class JSON {
|
||||
private Gson gson;
|
||||
private boolean isLenientOnJson = false;
|
||||
private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
|
||||
private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
|
||||
private static Gson gson;
|
||||
private static boolean isLenientOnJson = false;
|
||||
private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
|
||||
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
|
||||
{{#joda}}
|
||||
private DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter();
|
||||
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||
private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter();
|
||||
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||
{{/joda}}
|
||||
{{#jsr310}}
|
||||
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
||||
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
||||
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||
{{/jsr310}}
|
||||
private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
|
||||
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static GsonBuilder createGson() {
|
||||
@@ -116,7 +116,7 @@ public class JSON {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
public JSON() {
|
||||
{
|
||||
gson = createGson()
|
||||
.registerTypeAdapter(Date.class, dateTypeAdapter)
|
||||
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
|
||||
@@ -146,7 +146,7 @@ public class JSON {
|
||||
*
|
||||
* @return Gson
|
||||
*/
|
||||
public Gson getGson() {
|
||||
public static Gson getGson() {
|
||||
return gson;
|
||||
}
|
||||
|
||||
@@ -155,11 +155,11 @@ public class JSON {
|
||||
*
|
||||
* @param gson Gson
|
||||
*/
|
||||
public void setGson(Gson gson) {
|
||||
this.gson = gson;
|
||||
public static void setGson(Gson gson) {
|
||||
JSON.gson = gson;
|
||||
}
|
||||
|
||||
public void setLenientOnJson(boolean lenientOnJson) {
|
||||
public static void setLenientOnJson(boolean lenientOnJson) {
|
||||
isLenientOnJson = lenientOnJson;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ public class JSON {
|
||||
* @param obj Object
|
||||
* @return String representation of the JSON
|
||||
*/
|
||||
public String serialize(Object obj) {
|
||||
public static String serialize(Object obj) {
|
||||
return gson.toJson(obj);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ public class JSON {
|
||||
* @return The deserialized Java object
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T deserialize(String body, Type returnType) {
|
||||
public static <T> T deserialize(String body, Type returnType) {
|
||||
try {
|
||||
if (isLenientOnJson) {
|
||||
JsonReader jsonReader = new JsonReader(new StringReader(body));
|
||||
@@ -206,7 +206,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for Byte Array type
|
||||
*/
|
||||
public class ByteArrayAdapter extends TypeAdapter<byte[]> {
|
||||
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
|
||||
|
||||
@Override
|
||||
public void write(JsonWriter out, byte[] value) throws IOException {
|
||||
@@ -235,7 +235,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for Joda DateTime type
|
||||
*/
|
||||
public class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
|
||||
public static class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
|
||||
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
@@ -278,7 +278,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for Joda LocalDate type
|
||||
*/
|
||||
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
@@ -316,11 +316,11 @@ public class JSON {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
public static void setDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
dateTimeTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
public void setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
localDateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for JSR310 OffsetDateTime type
|
||||
*/
|
||||
public class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
|
||||
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
|
||||
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
@@ -373,7 +373,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for JSR310 LocalDate type
|
||||
*/
|
||||
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
@@ -411,11 +411,11 @@ public class JSON {
|
||||
}
|
||||
}
|
||||
|
||||
public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
offsetDateTimeTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
public void setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
localDateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ public class JSON {
|
||||
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
|
||||
* (more efficient than SimpleDateFormat).
|
||||
*/
|
||||
public class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
|
||||
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
|
||||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
@@ -478,7 +478,7 @@ public class JSON {
|
||||
* Gson TypeAdapter for java.util.Date type
|
||||
* If the dateFormat is null, ISO8601Utils will be used.
|
||||
*/
|
||||
public class DateTypeAdapter extends TypeAdapter<Date> {
|
||||
public static class DateTypeAdapter extends TypeAdapter<Date> {
|
||||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
@@ -531,11 +531,11 @@ public class JSON {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDateFormat(DateFormat dateFormat) {
|
||||
public static void setDateFormat(DateFormat dateFormat) {
|
||||
dateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
public void setSqlDateFormat(DateFormat dateFormat) {
|
||||
public static void setSqlDateFormat(DateFormat dateFormat) {
|
||||
sqlDateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,14 +90,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
|
||||
{{/discriminator}}
|
||||
{{/useOneOfDiscriminatorLookup}}
|
||||
|
||||
{{#anyOf}}
|
||||
// deserialize {{{.}}}
|
||||
try {
|
||||
deserialized = adapter{{.}}.fromJsonTree(jsonObject);
|
||||
// validate the JSON object to see if any excpetion is thrown
|
||||
{{.}}.validateJsonObject(jsonObject);
|
||||
log.log(Level.FINER, "Input data matches schema '{{{.}}}'");
|
||||
{{classname}} ret = new {{classname}}();
|
||||
ret.setActualInstance(deserialized);
|
||||
ret.setActualInstance(adapter{{.}}.fromJsonTree(jsonObject));
|
||||
return ret;
|
||||
} catch (Exception e) {
|
||||
// deserialization failed, continue
|
||||
@@ -105,7 +105,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
{{/anyOf}}
|
||||
throw new IOException(String.format("Failed deserialization for {{classname}} as data doesn't match anyOf schmeas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObject.toString()));
|
||||
|
||||
throw new IOException(String.format("Failed deserialization for {{classname}}: no class matched. JSON: %s", jsonObject.toString()));
|
||||
}
|
||||
}.nullSafe();
|
||||
}
|
||||
@@ -188,4 +189,48 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
{{/anyOf}}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to {{classname}}
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
// validate anyOf schemas one by one
|
||||
int validCount = 0;
|
||||
{{#anyOf}}
|
||||
// validate the json string with {{{.}}}
|
||||
try {
|
||||
{{{.}}}.validateJsonObject(jsonObj);
|
||||
return; // return earlier as at least one schema is valid with respect to the Json object
|
||||
//validCount++;
|
||||
} catch (Exception e) {
|
||||
// continue to the next one
|
||||
}
|
||||
{{/anyOf}}
|
||||
if (validCount == 0) {
|
||||
throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {{classname}} given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of {{classname}}
|
||||
* @throws IOException if the JSON string is invalid with respect to {{classname}}
|
||||
*/
|
||||
public static {{{classname}}} fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, {{{classname}}}.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of {{classname}} to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,11 +91,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
{{/discriminator}}
|
||||
{{/useOneOfDiscriminatorLookup}}
|
||||
int match = 0;
|
||||
TypeAdapter actualAdapter = elementAdapter;
|
||||
|
||||
{{#oneOf}}
|
||||
// deserialize {{{.}}}
|
||||
try {
|
||||
deserialized = adapter{{.}}.fromJsonTree(jsonObject);
|
||||
// validate the JSON object to see if any excpetion is thrown
|
||||
{{.}}.validateJsonObject(jsonObject);
|
||||
actualAdapter = adapter{{.}};
|
||||
match++;
|
||||
log.log(Level.FINER, "Input data matches schema '{{{.}}}'");
|
||||
} catch (Exception e) {
|
||||
@@ -106,7 +109,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
{{/oneOf}}
|
||||
if (match == 1) {
|
||||
{{classname}} ret = new {{classname}}();
|
||||
ret.setActualInstance(deserialized);
|
||||
ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -193,4 +196,47 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
{{/oneOf}}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to {{classname}}
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
// validate oneOf schemas one by one
|
||||
int validCount = 0;
|
||||
{{#oneOf}}
|
||||
// validate the json string with {{{.}}}
|
||||
try {
|
||||
{{{.}}}.validateJsonObject(jsonObj);
|
||||
validCount++;
|
||||
} catch (Exception e) {
|
||||
// continue to the next one
|
||||
}
|
||||
{{/oneOf}}
|
||||
if (validCount != 1) {
|
||||
throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {{classname}} given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of {{classname}}
|
||||
* @throws IOException if the JSON string is invalid with respect to {{classname}}
|
||||
*/
|
||||
public static {{{classname}}} fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, {{{classname}}}.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of {{classname}} to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -14,6 +15,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import {{invokerPackage}}.JSON;
|
||||
|
||||
/**
|
||||
* {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}}
|
||||
* @deprecated{{/isDeprecated}}
|
||||
@@ -379,7 +382,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
}
|
||||
};
|
||||
{{/parcelableModel}}
|
||||
{{^hasChildren}}
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -397,6 +400,95 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
{{/requiredVars}}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to {{classname}}
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if ({{classname}}.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
{{^hasChildren}}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!{{classname}}.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
{{#requiredVars}}
|
||||
{{#-first}}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : {{classname}}.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
{{/-first}}
|
||||
{{/requiredVars}}
|
||||
{{/hasChildren}}
|
||||
{{^discriminator}}
|
||||
{{#vars}}
|
||||
{{#isArray}}
|
||||
{{#items.isModel}}
|
||||
JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}");
|
||||
{{#isRequired}}
|
||||
// validate the required field `{{{baseName}}}` (array)
|
||||
for (int i = 0; i < jsonArray{{name}}.size(); i++) {
|
||||
{{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject());
|
||||
};
|
||||
{{/isRequired}}
|
||||
{{^isRequired}}
|
||||
// validate the optional field `{{{baseName}}}` (array)
|
||||
if (jsonArray{{name}} != null) {
|
||||
for (int i = 0; i < jsonArray{{name}}.size(); i++) {
|
||||
{{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject());
|
||||
};
|
||||
}
|
||||
{{/isRequired}}
|
||||
{{/items.isModel}}
|
||||
{{/isArray}}
|
||||
{{^isContainer}}
|
||||
{{#isModel}}
|
||||
{{#isRequired}}
|
||||
// validate the required field `{{{baseName}}}`
|
||||
{{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}"));
|
||||
{{/isRequired}}
|
||||
{{^isRequired}}
|
||||
// validate the optional field `{{{baseName}}}`
|
||||
if (jsonObj.getAsJsonObject("{{{baseName}}}") != null) {
|
||||
{{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}"));
|
||||
}
|
||||
{{/isRequired}}
|
||||
{{/isModel}}
|
||||
{{/isContainer}}
|
||||
{{/vars}}
|
||||
{{/discriminator}}
|
||||
{{#hasChildren}}
|
||||
{{#discriminator}}
|
||||
|
||||
String discriminatorValue = jsonObj.get("{{{propertyBaseName}}}").getAsString();
|
||||
switch (discriminatorValue) {
|
||||
{{#mappedModels}}
|
||||
case "{{mappingName}}":
|
||||
{{modelName}}.validateJsonObject(jsonObj);
|
||||
break;
|
||||
{{/mappedModels}}
|
||||
default:
|
||||
throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue));
|
||||
}
|
||||
{{/discriminator}}
|
||||
{{/hasChildren}}
|
||||
}
|
||||
|
||||
{{^hasChildren}}
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -417,31 +509,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
|
||||
@Override
|
||||
public {{classname}} read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!{{classname}}.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `{{classname}}` properties");
|
||||
}
|
||||
}
|
||||
|
||||
{{#requiredVars}}
|
||||
{{#-first}}
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : {{classname}}.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
{{/-first}}
|
||||
{{/requiredVars}}
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
{{/hasChildren}}
|
||||
|
||||
/**
|
||||
* Create an instance of {{classname}} given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of {{classname}}
|
||||
* @throws IOException if the JSON string is invalid with respect to {{classname}}
|
||||
*/
|
||||
public static {{{classname}}} fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, {{{classname}}}.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of {{classname}} to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2143,3 +2143,42 @@ components:
|
||||
deprecated: true
|
||||
items:
|
||||
$ref: '#/components/schemas/Bar'
|
||||
PetWithRequiredTags:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
- tags
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
x-is-unique: true
|
||||
category:
|
||||
$ref: '#/components/schemas/Category'
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
photoUrls:
|
||||
type: array
|
||||
xml:
|
||||
name: photoUrl
|
||||
wrapped: true
|
||||
items:
|
||||
type: string
|
||||
tags:
|
||||
type: array
|
||||
xml:
|
||||
name: tag
|
||||
wrapped: true
|
||||
items:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
xml:
|
||||
name: Pet
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | `String` | Test capitalization | [optional property]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | `String` | | [optional property]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import io.micronaut.core.annotation.*;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
|
||||
@Introspected
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,99 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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.model;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Arrays;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.Valid;
|
||||
import io.micronaut.core.annotation.*;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@JsonTypeName("List")
|
||||
@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen")
|
||||
@Introspected
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,30 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import io.swagger.annotations.ApiModel
|
||||
import io.swagger.annotations.ApiModelProperty
|
||||
import io.micronaut.test.extensions.spock.annotation.MicronautTest
|
||||
import spock.lang.Specification
|
||||
import jakarta.inject.Inject
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@MicronautTest
|
||||
public class ModelFileSpec extends Specification {
|
||||
private final ModelFile model = new ModelFile()
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
void 'ModelFile test'() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
void 'ModelFile property sourceURI test'() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.openapitools.model
|
||||
|
||||
import io.swagger.annotations.ApiModel
|
||||
import io.swagger.annotations.ApiModelProperty
|
||||
import io.micronaut.test.extensions.spock.annotation.MicronautTest
|
||||
import spock.lang.Specification
|
||||
import jakarta.inject.Inject
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@MicronautTest
|
||||
public class ModelListSpec extends Specification {
|
||||
private final ModelList model = new ModelList()
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
void 'ModelList test'() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
void 'ModelList property _123list test'() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,108 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@JsonTypeName("List")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.concurrent.Immutable
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,109 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@JsonTypeName("List")
|
||||
@javax.annotation.concurrent.Immutable
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,108 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@JsonTypeName("List")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,108 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@JsonTypeName("List")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
14
samples/client/petstore/java/jersey1/docs/ModelFile.md
Normal file
14
samples/client/petstore/java/jersey1/docs/ModelFile.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
13
samples/client/petstore/java/jersey1/docs/ModelList.md
Normal file
13
samples/client/petstore/java/jersey1/docs/ModelList.md
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@JsonTypeName("File")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,108 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@JsonTypeName("List")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this File object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,112 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this List object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
14
samples/client/petstore/java/jersey2-java8/docs/ModelFile.md
Normal file
14
samples/client/petstore/java/jersey2-java8/docs/ModelFile.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
13
samples/client/petstore/java/jersey2-java8/docs/ModelList.md
Normal file
13
samples/client/petstore/java/jersey2-java8/docs/ModelList.md
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this File object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,112 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this List object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
14
samples/client/petstore/java/native-async/docs/ModelFile.md
Normal file
14
samples/client/petstore/java/native-async/docs/ModelFile.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
13
samples/client/petstore/java/native-async/docs/ModelList.md
Normal file
13
samples/client/petstore/java/native-async/docs/ModelList.md
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this File object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,111 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this List object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
14
samples/client/petstore/java/native/docs/ModelFile.md
Normal file
14
samples/client/petstore/java/native/docs/ModelFile.md
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
13
samples/client/petstore/java/native/docs/ModelList.md
Normal file
13
samples/client/petstore/java/native/docs/ModelList.md
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@JsonPropertyOrder({
|
||||
ModelFile.JSON_PROPERTY_SOURCE_U_R_I
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI";
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_SOURCE_U_R_I)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this File object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,111 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@JsonPropertyOrder({
|
||||
ModelList.JSON_PROPERTY_123LIST
|
||||
})
|
||||
@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String JSON_PROPERTY_123LIST = "123-list";
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(JSON_PROPERTY_123LIST)
|
||||
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if this List object is equal to o.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Must be named `File` for test.
|
||||
*/
|
||||
@ApiModel(description = "Must be named `File` for test.")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelFile {
|
||||
public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI";
|
||||
@SerializedName(SERIALIZED_NAME_SOURCE_U_R_I)
|
||||
private String sourceURI;
|
||||
|
||||
public ModelFile() {
|
||||
}
|
||||
|
||||
public ModelFile sourceURI(String sourceURI) {
|
||||
|
||||
this.sourceURI = sourceURI;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test capitalization
|
||||
* @return sourceURI
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "Test capitalization")
|
||||
|
||||
public String getSourceURI() {
|
||||
return sourceURI;
|
||||
}
|
||||
|
||||
|
||||
public void setSourceURI(String sourceURI) {
|
||||
this.sourceURI = sourceURI;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelFile _file = (ModelFile) o;
|
||||
return Objects.equals(this.sourceURI, _file.sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sourceURI);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelFile {\n");
|
||||
sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).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,100 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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 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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* ModelList
|
||||
*/
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||
public class ModelList {
|
||||
public static final String SERIALIZED_NAME_123LIST = "123-list";
|
||||
@SerializedName(SERIALIZED_NAME_123LIST)
|
||||
private String _123list;
|
||||
|
||||
public ModelList() {
|
||||
}
|
||||
|
||||
public ModelList _123list(String _123list) {
|
||||
|
||||
this._123list = _123list;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get _123list
|
||||
* @return _123list
|
||||
**/
|
||||
@javax.annotation.Nullable
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
public String get123list() {
|
||||
return _123list;
|
||||
}
|
||||
|
||||
|
||||
public void set123list(String _123list) {
|
||||
this._123list = _123list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
ModelList _list = (ModelList) o;
|
||||
return Objects.equals(this._123list, _list._123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(_123list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class ModelList {\n");
|
||||
sb.append(" _123list: ").append(toIndentedString(_123list)).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 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,41 +21,31 @@ import com.google.gson.stream.JsonWriter;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for FileSchemaTestClass
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
public class FileSchemaTestClassTest {
|
||||
private final FileSchemaTestClass model = new FileSchemaTestClass();
|
||||
public class ModelFileTest {
|
||||
private final ModelFile model = new ModelFile();
|
||||
|
||||
/**
|
||||
* Model tests for FileSchemaTestClass
|
||||
* Model tests for ModelFile
|
||||
*/
|
||||
@Test
|
||||
public void testFileSchemaTestClass() {
|
||||
// TODO: test FileSchemaTestClass
|
||||
public void testModelFile() {
|
||||
// TODO: test ModelFile
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'file'
|
||||
* Test the property 'sourceURI'
|
||||
*/
|
||||
@Test
|
||||
public void fileTest() {
|
||||
// TODO: test file
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property 'files'
|
||||
*/
|
||||
@Test
|
||||
public void filesTest() {
|
||||
// TODO: test files
|
||||
public void sourceURITest() {
|
||||
// TODO: test sourceURI
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* 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.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 io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.IOException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
public class ModelListTest {
|
||||
private final ModelList model = new ModelList();
|
||||
|
||||
/**
|
||||
* Model tests for ModelList
|
||||
*/
|
||||
@Test
|
||||
public void testModelList() {
|
||||
// TODO: test ModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the property '_123list'
|
||||
*/
|
||||
@Test
|
||||
public void _123listTest() {
|
||||
// TODO: test _123list
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,7 +34,6 @@ docs/EnumTest.md
|
||||
docs/EquilateralTriangle.md
|
||||
docs/FakeApi.md
|
||||
docs/FakeClassnameTags123Api.md
|
||||
docs/FileSchemaTestClass.md
|
||||
docs/Foo.md
|
||||
docs/FormatTest.md
|
||||
docs/Fruit.md
|
||||
@@ -65,6 +64,7 @@ docs/OuterEnumIntegerDefaultValue.md
|
||||
docs/ParentPet.md
|
||||
docs/Pet.md
|
||||
docs/PetApi.md
|
||||
docs/PetWithRequiredTags.md
|
||||
docs/Pig.md
|
||||
docs/Quadrilateral.md
|
||||
docs/QuadrilateralInterface.md
|
||||
@@ -147,7 +147,6 @@ src/main/java/org/openapitools/client/model/EnumArrays.java
|
||||
src/main/java/org/openapitools/client/model/EnumClass.java
|
||||
src/main/java/org/openapitools/client/model/EnumTest.java
|
||||
src/main/java/org/openapitools/client/model/EquilateralTriangle.java
|
||||
src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
|
||||
src/main/java/org/openapitools/client/model/Foo.java
|
||||
src/main/java/org/openapitools/client/model/FormatTest.java
|
||||
src/main/java/org/openapitools/client/model/Fruit.java
|
||||
@@ -177,6 +176,7 @@ src/main/java/org/openapitools/client/model/OuterEnumInteger.java
|
||||
src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java
|
||||
src/main/java/org/openapitools/client/model/ParentPet.java
|
||||
src/main/java/org/openapitools/client/model/Pet.java
|
||||
src/main/java/org/openapitools/client/model/PetWithRequiredTags.java
|
||||
src/main/java/org/openapitools/client/model/Pig.java
|
||||
src/main/java/org/openapitools/client/model/Quadrilateral.java
|
||||
src/main/java/org/openapitools/client/model/QuadrilateralInterface.java
|
||||
|
||||
@@ -121,7 +121,6 @@ Class | Method | HTTP request | Description
|
||||
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
*FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
|
||||
*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -182,7 +181,6 @@ Class | Method | HTTP request | Description
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
- [EquilateralTriangle](docs/EquilateralTriangle.md)
|
||||
- [FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [Foo](docs/Foo.md)
|
||||
- [FormatTest](docs/FormatTest.md)
|
||||
- [Fruit](docs/Fruit.md)
|
||||
@@ -212,6 +210,7 @@ Class | Method | HTTP request | Description
|
||||
- [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
|
||||
- [ParentPet](docs/ParentPet.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [PetWithRequiredTags](docs/PetWithRequiredTags.md)
|
||||
- [Pig](docs/Pig.md)
|
||||
- [Quadrilateral](docs/Quadrilateral.md)
|
||||
- [QuadrilateralInterface](docs/QuadrilateralInterface.md)
|
||||
|
||||
@@ -1107,24 +1107,6 @@ paths:
|
||||
- $another-fake?
|
||||
x-contentType: application/json
|
||||
x-accepts: application/json
|
||||
/fake/body-with-file-schema:
|
||||
put:
|
||||
description: For this test, the body for this request much reference a schema
|
||||
named `File`.
|
||||
operationId: testBodyWithFileSchema
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FileSchemaTestClass'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Success
|
||||
tags:
|
||||
- fake
|
||||
x-contentType: application/json
|
||||
x-accepts: application/json
|
||||
/fake/test-query-parameters:
|
||||
put:
|
||||
description: To test the collection format in query parameters
|
||||
@@ -1934,25 +1916,8 @@ components:
|
||||
additionalProperties:
|
||||
type: boolean
|
||||
type: object
|
||||
FileSchemaTestClass:
|
||||
example:
|
||||
file:
|
||||
sourceURI: sourceURI
|
||||
files:
|
||||
- sourceURI: sourceURI
|
||||
- sourceURI: sourceURI
|
||||
properties:
|
||||
file:
|
||||
$ref: '#/components/schemas/File'
|
||||
files:
|
||||
items:
|
||||
$ref: '#/components/schemas/File'
|
||||
type: array
|
||||
type: object
|
||||
File:
|
||||
description: Must be named `File` for test.
|
||||
example:
|
||||
sourceURI: sourceURI
|
||||
properties:
|
||||
sourceURI:
|
||||
description: Test capitalization
|
||||
@@ -2279,6 +2244,45 @@ components:
|
||||
$ref: '#/components/schemas/Bar'
|
||||
type: array
|
||||
type: object
|
||||
PetWithRequiredTags:
|
||||
properties:
|
||||
id:
|
||||
format: int64
|
||||
type: integer
|
||||
x-is-unique: true
|
||||
category:
|
||||
$ref: '#/components/schemas/Category'
|
||||
name:
|
||||
example: doggie
|
||||
type: string
|
||||
photoUrls:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
xml:
|
||||
name: photoUrl
|
||||
wrapped: true
|
||||
tags:
|
||||
items:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
type: array
|
||||
xml:
|
||||
name: tag
|
||||
wrapped: true
|
||||
status:
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
- tags
|
||||
type: object
|
||||
xml:
|
||||
name: Pet
|
||||
inline_response_default:
|
||||
example:
|
||||
string:
|
||||
|
||||
@@ -10,7 +10,6 @@ Method | HTTP request | Description
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -357,63 +356,6 @@ No authorization required
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Got named array of enums | - |
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### 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.FakeApi;
|
||||
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
||||
defaultClient.setBasePath("http://petstore.swagger.io:80/v2");
|
||||
|
||||
FakeApi apiInstance = new FakeApi(defaultClient);
|
||||
FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass);
|
||||
} catch (ApiException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
### HTTP response details
|
||||
| Status code | Description | Response headers |
|
||||
|-------------|-------------|------------------|
|
||||
**200** | Success | - |
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
# ModelFile
|
||||
|
||||
Must be named `File` for test.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**sourceURI** | **String** | Test capitalization | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
|
||||
# ModelList
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**_123list** | **String** | | [optional]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
# PetWithRequiredTags
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **Long** | | [optional]
|
||||
**category** | [**Category**](Category.md) | | [optional]
|
||||
**name** | **String** | |
|
||||
**photoUrls** | **List<String>** | |
|
||||
**tags** | [**List<Tag>**](Tag.md) | |
|
||||
**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional]
|
||||
|
||||
|
||||
|
||||
## Enum: StatusEnum
|
||||
|
||||
Name | Value
|
||||
---- | -----
|
||||
AVAILABLE | "available"
|
||||
PENDING | "pending"
|
||||
SOLD | "sold"
|
||||
|
||||
|
||||
|
||||
@@ -47,13 +47,13 @@ import java.util.HashMap;
|
||||
* backward-compatibility
|
||||
*/
|
||||
public class JSON {
|
||||
private Gson gson;
|
||||
private boolean isLenientOnJson = false;
|
||||
private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
|
||||
private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
|
||||
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
||||
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||
private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
|
||||
private static Gson gson;
|
||||
private static boolean isLenientOnJson = false;
|
||||
private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
|
||||
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
|
||||
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
|
||||
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
|
||||
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static GsonBuilder createGson() {
|
||||
@@ -213,7 +213,7 @@ public class JSON {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
public JSON() {
|
||||
{
|
||||
gson = createGson()
|
||||
.registerTypeAdapter(Date.class, dateTypeAdapter)
|
||||
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
|
||||
@@ -244,7 +244,6 @@ public class JSON {
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory())
|
||||
@@ -269,6 +268,7 @@ public class JSON {
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.PetWithRequiredTags.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory())
|
||||
.registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory())
|
||||
@@ -293,7 +293,7 @@ public class JSON {
|
||||
*
|
||||
* @return Gson
|
||||
*/
|
||||
public Gson getGson() {
|
||||
public static Gson getGson() {
|
||||
return gson;
|
||||
}
|
||||
|
||||
@@ -302,11 +302,11 @@ public class JSON {
|
||||
*
|
||||
* @param gson Gson
|
||||
*/
|
||||
public void setGson(Gson gson) {
|
||||
this.gson = gson;
|
||||
public static void setGson(Gson gson) {
|
||||
JSON.gson = gson;
|
||||
}
|
||||
|
||||
public void setLenientOnJson(boolean lenientOnJson) {
|
||||
public static void setLenientOnJson(boolean lenientOnJson) {
|
||||
isLenientOnJson = lenientOnJson;
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ public class JSON {
|
||||
* @param obj Object
|
||||
* @return String representation of the JSON
|
||||
*/
|
||||
public String serialize(Object obj) {
|
||||
public static String serialize(Object obj) {
|
||||
return gson.toJson(obj);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ public class JSON {
|
||||
* @return The deserialized Java object
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T deserialize(String body, Type returnType) {
|
||||
public static <T> T deserialize(String body, Type returnType) {
|
||||
try {
|
||||
if (isLenientOnJson) {
|
||||
JsonReader jsonReader = new JsonReader(new StringReader(body));
|
||||
@@ -353,7 +353,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for Byte Array type
|
||||
*/
|
||||
public class ByteArrayAdapter extends TypeAdapter<byte[]> {
|
||||
public static class ByteArrayAdapter extends TypeAdapter<byte[]> {
|
||||
|
||||
@Override
|
||||
public void write(JsonWriter out, byte[] value) throws IOException {
|
||||
@@ -381,7 +381,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for JSR310 OffsetDateTime type
|
||||
*/
|
||||
public class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
|
||||
public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> {
|
||||
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
@@ -425,7 +425,7 @@ public class JSON {
|
||||
/**
|
||||
* Gson TypeAdapter for JSR310 LocalDate type
|
||||
*/
|
||||
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||
public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
|
||||
|
||||
private DateTimeFormatter formatter;
|
||||
|
||||
@@ -463,11 +463,11 @@ public class JSON {
|
||||
}
|
||||
}
|
||||
|
||||
public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
|
||||
offsetDateTimeTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
public void setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
|
||||
localDateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ public class JSON {
|
||||
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
|
||||
* (more efficient than SimpleDateFormat).
|
||||
*/
|
||||
public class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
|
||||
public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> {
|
||||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
@@ -529,7 +529,7 @@ public class JSON {
|
||||
* Gson TypeAdapter for java.util.Date type
|
||||
* If the dateFormat is null, ISO8601Utils will be used.
|
||||
*/
|
||||
public class DateTypeAdapter extends TypeAdapter<Date> {
|
||||
public static class DateTypeAdapter extends TypeAdapter<Date> {
|
||||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
@@ -582,11 +582,11 @@ public class JSON {
|
||||
}
|
||||
}
|
||||
|
||||
public void setDateFormat(DateFormat dateFormat) {
|
||||
public static void setDateFormat(DateFormat dateFormat) {
|
||||
dateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
|
||||
public void setSqlDateFormat(DateFormat dateFormat) {
|
||||
public static void setSqlDateFormat(DateFormat dateFormat) {
|
||||
sqlDateTypeAdapter.setFormat(dateFormat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import org.openapitools.client.model.Client;
|
||||
import java.io.File;
|
||||
import org.openapitools.client.model.FileSchemaTestClass;
|
||||
import org.openapitools.client.model.HealthCheckResult;
|
||||
import org.threeten.bp.LocalDate;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
@@ -740,115 +739,6 @@ public class FakeApi {
|
||||
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithFileSchema
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param _callback Callback for upload/download progress
|
||||
* @return Call to execute
|
||||
* @throws ApiException If fail to serialize the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Success </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException {
|
||||
Object localVarPostBody = fileSchemaTestClass;
|
||||
|
||||
// create path and map variables
|
||||
String localVarPath = "/fake/body-with-file-schema";
|
||||
|
||||
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>();
|
||||
|
||||
final String[] localVarAccepts = {
|
||||
|
||||
};
|
||||
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
|
||||
if (localVarAccept != null) {
|
||||
localVarHeaderParams.put("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
final String[] localVarContentTypes = {
|
||||
"application/json"
|
||||
};
|
||||
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
|
||||
if (localVarHeaderParams != null) {
|
||||
localVarHeaderParams.put("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
String[] localVarAuthNames = new String[] { };
|
||||
return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException {
|
||||
|
||||
// verify the required parameter 'fileSchemaTestClass' is set
|
||||
if (fileSchemaTestClass == null) {
|
||||
throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)");
|
||||
}
|
||||
|
||||
|
||||
okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback);
|
||||
return localVarCall;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Success </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @return ApiResponse<Void>
|
||||
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Success </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public ApiResponse<Void> testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException {
|
||||
okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null);
|
||||
return localVarApiClient.execute(localVarCall);
|
||||
}
|
||||
|
||||
/**
|
||||
* (asynchronously)
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass (required)
|
||||
* @param _callback The callback to be executed when the API call finishes
|
||||
* @return The request call
|
||||
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
|
||||
* @http.response.details
|
||||
<table summary="Response Details" border="1">
|
||||
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
|
||||
<tr><td> 200 </td><td> Success </td><td> - </td></tr>
|
||||
</table>
|
||||
*/
|
||||
public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback<Void> _callback) throws ApiException {
|
||||
|
||||
okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, _callback);
|
||||
localVarApiClient.executeAsync(localVarCall, _callback);
|
||||
return localVarCall;
|
||||
}
|
||||
/**
|
||||
* Build call for testBodyWithQueryParams
|
||||
* @param query (required)
|
||||
|
||||
@@ -30,6 +30,7 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -44,6 +45,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* AdditionalPropertiesClass
|
||||
*/
|
||||
@@ -362,6 +365,7 @@ public class AdditionalPropertiesClass {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -381,6 +385,29 @@ public class AdditionalPropertiesClass {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -401,19 +428,33 @@ public class AdditionalPropertiesClass {
|
||||
|
||||
@Override
|
||||
public AdditionalPropertiesClass read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AdditionalPropertiesClass` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of AdditionalPropertiesClass given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of AdditionalPropertiesClass
|
||||
* @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass
|
||||
*/
|
||||
public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of AdditionalPropertiesClass to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.openapitools.client.model.Dog;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -42,6 +43,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Animal
|
||||
*/
|
||||
@@ -144,4 +147,68 @@ public class Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
static {
|
||||
// a set of all properties/fields (JSON key names)
|
||||
openapiFields = new HashSet<String>();
|
||||
openapiFields.add("className");
|
||||
openapiFields.add("color");
|
||||
|
||||
// a set of required properties/fields (JSON key names)
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
openapiRequiredFields.add("className");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Animal
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Animal.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
String discriminatorValue = jsonObj.get("className").getAsString();
|
||||
switch (discriminatorValue) {
|
||||
case "Cat":
|
||||
Cat.validateJsonObject(jsonObj);
|
||||
break;
|
||||
case "Dog":
|
||||
Dog.validateJsonObject(jsonObj);
|
||||
break;
|
||||
default:
|
||||
throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance of Animal given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Animal
|
||||
* @throws IOException if the JSON string is invalid with respect to Animal
|
||||
*/
|
||||
public static Animal fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Animal.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Animal to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Apple
|
||||
*/
|
||||
@@ -141,6 +144,7 @@ public class Apple {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -154,6 +158,29 @@ public class Apple {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Apple
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Apple.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Apple is not found in the empty JSON string", Apple.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Apple.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Apple` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -174,19 +201,33 @@ public class Apple {
|
||||
|
||||
@Override
|
||||
public Apple read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Apple.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Apple` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Apple given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Apple
|
||||
* @throws IOException if the JSON string is invalid with respect to Apple
|
||||
*/
|
||||
public static Apple fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Apple.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Apple to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* AppleReq
|
||||
*/
|
||||
@@ -141,6 +144,7 @@ public class AppleReq {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -155,6 +159,36 @@ public class AppleReq {
|
||||
openapiRequiredFields.add("cultivar");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to AppleReq
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (AppleReq.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in AppleReq is not found in the empty JSON string", AppleReq.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!AppleReq.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AppleReq` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : AppleReq.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -175,26 +209,33 @@ public class AppleReq {
|
||||
|
||||
@Override
|
||||
public AppleReq read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!AppleReq.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AppleReq` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : AppleReq.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of AppleReq given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of AppleReq
|
||||
* @throws IOException if the JSON string is invalid with respect to AppleReq
|
||||
*/
|
||||
public static AppleReq fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, AppleReq.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of AppleReq to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -43,6 +44,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
@@ -123,6 +126,7 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -135,6 +139,29 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -155,19 +182,33 @@ public class ArrayOfArrayOfNumberOnly {
|
||||
|
||||
@Override
|
||||
public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of ArrayOfArrayOfNumberOnly given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of ArrayOfArrayOfNumberOnly
|
||||
* @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly
|
||||
*/
|
||||
public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -43,6 +44,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* ArrayOfNumberOnly
|
||||
*/
|
||||
@@ -123,6 +126,7 @@ public class ArrayOfNumberOnly {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -135,6 +139,29 @@ public class ArrayOfNumberOnly {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -155,19 +182,33 @@ public class ArrayOfNumberOnly {
|
||||
|
||||
@Override
|
||||
public ArrayOfNumberOnly read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfNumberOnly` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of ArrayOfNumberOnly given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of ArrayOfNumberOnly
|
||||
* @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly
|
||||
*/
|
||||
public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of ArrayOfNumberOnly to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.openapitools.client.model.ReadOnlyFirst;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -43,6 +44,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* ArrayTest
|
||||
*/
|
||||
@@ -197,6 +200,7 @@ public class ArrayTest {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -211,6 +215,29 @@ public class ArrayTest {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to ArrayTest
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (ArrayTest.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!ArrayTest.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -231,19 +258,33 @@ public class ArrayTest {
|
||||
|
||||
@Override
|
||||
public ArrayTest read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!ArrayTest.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayTest` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of ArrayTest given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of ArrayTest
|
||||
* @throws IOException if the JSON string is invalid with respect to ArrayTest
|
||||
*/
|
||||
public static ArrayTest fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, ArrayTest.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of ArrayTest to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.math.BigDecimal;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -41,6 +42,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Banana
|
||||
*/
|
||||
@@ -113,6 +116,7 @@ public class Banana {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -125,6 +129,29 @@ public class Banana {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Banana
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Banana.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Banana is not found in the empty JSON string", Banana.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Banana.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Banana` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -145,19 +172,33 @@ public class Banana {
|
||||
|
||||
@Override
|
||||
public Banana read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Banana.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Banana` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Banana given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Banana
|
||||
* @throws IOException if the JSON string is invalid with respect to Banana
|
||||
*/
|
||||
public static Banana fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Banana.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Banana to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.math.BigDecimal;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -41,6 +42,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* BananaReq
|
||||
*/
|
||||
@@ -142,6 +145,7 @@ public class BananaReq {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -156,6 +160,36 @@ public class BananaReq {
|
||||
openapiRequiredFields.add("lengthCm");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to BananaReq
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (BananaReq.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in BananaReq is not found in the empty JSON string", BananaReq.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!BananaReq.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BananaReq` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : BananaReq.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -176,26 +210,33 @@ public class BananaReq {
|
||||
|
||||
@Override
|
||||
public BananaReq read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!BananaReq.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BananaReq` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : BananaReq.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of BananaReq given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of BananaReq
|
||||
* @throws IOException if the JSON string is invalid with respect to BananaReq
|
||||
*/
|
||||
public static BananaReq fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, BananaReq.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of BananaReq to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* BasquePig
|
||||
*/
|
||||
@@ -112,6 +115,7 @@ public class BasquePig {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -125,6 +129,36 @@ public class BasquePig {
|
||||
openapiRequiredFields.add("className");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to BasquePig
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (BasquePig.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in BasquePig is not found in the empty JSON string", BasquePig.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!BasquePig.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BasquePig` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : BasquePig.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -145,26 +179,33 @@ public class BasquePig {
|
||||
|
||||
@Override
|
||||
public BasquePig read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!BasquePig.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BasquePig` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : BasquePig.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of BasquePig given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of BasquePig
|
||||
* @throws IOException if the JSON string is invalid with respect to BasquePig
|
||||
*/
|
||||
public static BasquePig fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, BasquePig.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of BasquePig to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Capitalization
|
||||
*/
|
||||
@@ -257,6 +260,7 @@ public class Capitalization {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -274,6 +278,29 @@ public class Capitalization {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Capitalization
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Capitalization.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Capitalization.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -294,19 +321,33 @@ public class Capitalization {
|
||||
|
||||
@Override
|
||||
public Capitalization read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Capitalization.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Capitalization` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Capitalization given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Capitalization
|
||||
* @throws IOException if the JSON string is invalid with respect to Capitalization
|
||||
*/
|
||||
public static Capitalization fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Capitalization.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Capitalization to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.openapitools.client.model.CatAllOf;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -42,6 +43,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Cat
|
||||
*/
|
||||
@@ -117,6 +120,7 @@ public class Cat extends Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -132,6 +136,36 @@ public class Cat extends Animal {
|
||||
openapiRequiredFields.add("className");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Cat
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Cat.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Cat.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Cat` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : Cat.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -152,26 +186,33 @@ public class Cat extends Animal {
|
||||
|
||||
@Override
|
||||
public Cat read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Cat.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Cat` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : Cat.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Cat given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Cat
|
||||
* @throws IOException if the JSON string is invalid with respect to Cat
|
||||
*/
|
||||
public static Cat fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Cat.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Cat to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* CatAllOf
|
||||
*/
|
||||
@@ -112,6 +115,7 @@ public class CatAllOf {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -124,6 +128,29 @@ public class CatAllOf {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to CatAllOf
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (CatAllOf.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!CatAllOf.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -144,19 +171,33 @@ public class CatAllOf {
|
||||
|
||||
@Override
|
||||
public CatAllOf read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!CatAllOf.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `CatAllOf` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of CatAllOf given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of CatAllOf
|
||||
* @throws IOException if the JSON string is invalid with respect to CatAllOf
|
||||
*/
|
||||
public static CatAllOf fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, CatAllOf.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of CatAllOf to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Category
|
||||
*/
|
||||
@@ -141,6 +144,7 @@ public class Category {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -155,6 +159,36 @@ public class Category {
|
||||
openapiRequiredFields.add("name");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Category
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Category.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Category.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : Category.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -175,26 +209,33 @@ public class Category {
|
||||
|
||||
@Override
|
||||
public Category read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Category.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Category` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : Category.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Category given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Category
|
||||
* @throws IOException if the JSON string is invalid with respect to Category
|
||||
*/
|
||||
public static Category fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Category.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Category to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
*/
|
||||
@@ -113,6 +116,7 @@ public class ClassModel {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -125,6 +129,29 @@ public class ClassModel {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to ClassModel
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (ClassModel.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!ClassModel.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -145,19 +172,33 @@ public class ClassModel {
|
||||
|
||||
@Override
|
||||
public ClassModel read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!ClassModel.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ClassModel` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of ClassModel given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of ClassModel
|
||||
* @throws IOException if the JSON string is invalid with respect to ClassModel
|
||||
*/
|
||||
public static ClassModel fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, ClassModel.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of ClassModel to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Client
|
||||
*/
|
||||
@@ -112,6 +115,7 @@ public class Client {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -124,6 +128,29 @@ public class Client {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Client
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Client.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Client.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -144,19 +171,33 @@ public class Client {
|
||||
|
||||
@Override
|
||||
public Client read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Client.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Client` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Client given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Client
|
||||
* @throws IOException if the JSON string is invalid with respect to Client
|
||||
*/
|
||||
public static Client fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Client.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Client to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.openapitools.client.model.ShapeInterface;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -42,6 +43,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* ComplexQuadrilateral
|
||||
*/
|
||||
@@ -143,6 +146,7 @@ public class ComplexQuadrilateral {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -158,6 +162,36 @@ public class ComplexQuadrilateral {
|
||||
openapiRequiredFields.add("quadrilateralType");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to ComplexQuadrilateral
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (ComplexQuadrilateral.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in ComplexQuadrilateral is not found in the empty JSON string", ComplexQuadrilateral.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ComplexQuadrilateral` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -178,26 +212,33 @@ public class ComplexQuadrilateral {
|
||||
|
||||
@Override
|
||||
public ComplexQuadrilateral read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ComplexQuadrilateral` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of ComplexQuadrilateral given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of ComplexQuadrilateral
|
||||
* @throws IOException if the JSON string is invalid with respect to ComplexQuadrilateral
|
||||
*/
|
||||
public static ComplexQuadrilateral fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, ComplexQuadrilateral.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of ComplexQuadrilateral to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* DanishPig
|
||||
*/
|
||||
@@ -112,6 +115,7 @@ public class DanishPig {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -125,6 +129,36 @@ public class DanishPig {
|
||||
openapiRequiredFields.add("className");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to DanishPig
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (DanishPig.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DanishPig is not found in the empty JSON string", DanishPig.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!DanishPig.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DanishPig` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : DanishPig.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -145,26 +179,33 @@ public class DanishPig {
|
||||
|
||||
@Override
|
||||
public DanishPig read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!DanishPig.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DanishPig` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : DanishPig.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DanishPig given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DanishPig
|
||||
* @throws IOException if the JSON string is invalid with respect to DanishPig
|
||||
*/
|
||||
public static DanishPig fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DanishPig.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DanishPig to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* DeprecatedObject
|
||||
* @deprecated
|
||||
@@ -114,6 +117,7 @@ public class DeprecatedObject {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -126,6 +130,29 @@ public class DeprecatedObject {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to DeprecatedObject
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (DeprecatedObject.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DeprecatedObject is not found in the empty JSON string", DeprecatedObject.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!DeprecatedObject.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeprecatedObject` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -146,19 +173,33 @@ public class DeprecatedObject {
|
||||
|
||||
@Override
|
||||
public DeprecatedObject read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!DeprecatedObject.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DeprecatedObject` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DeprecatedObject given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DeprecatedObject
|
||||
* @throws IOException if the JSON string is invalid with respect to DeprecatedObject
|
||||
*/
|
||||
public static DeprecatedObject fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DeprecatedObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DeprecatedObject to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.openapitools.client.model.DogAllOf;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -42,6 +43,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Dog
|
||||
*/
|
||||
@@ -117,6 +120,7 @@ public class Dog extends Animal {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -132,6 +136,36 @@ public class Dog extends Animal {
|
||||
openapiRequiredFields.add("className");
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Dog
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Dog.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Dog.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : Dog.openapiRequiredFields) {
|
||||
if (jsonObj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -152,26 +186,33 @@ public class Dog extends Animal {
|
||||
|
||||
@Override
|
||||
public Dog read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Dog.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Dog` properties");
|
||||
}
|
||||
}
|
||||
|
||||
// check to make sure all required properties/fields are present in the JSON string
|
||||
for (String requiredField : Dog.openapiRequiredFields) {
|
||||
if (obj.get(requiredField) == null) {
|
||||
throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Dog given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Dog
|
||||
* @throws IOException if the JSON string is invalid with respect to Dog
|
||||
*/
|
||||
public static Dog fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Dog.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Dog to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.io.IOException;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -40,6 +41,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* DogAllOf
|
||||
*/
|
||||
@@ -112,6 +115,7 @@ public class DogAllOf {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -124,6 +128,29 @@ public class DogAllOf {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to DogAllOf
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (DogAllOf.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!DogAllOf.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -144,19 +171,33 @@ public class DogAllOf {
|
||||
|
||||
@Override
|
||||
public DogAllOf read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!DogAllOf.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DogAllOf` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of DogAllOf given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of DogAllOf
|
||||
* @throws IOException if the JSON string is invalid with respect to DogAllOf
|
||||
*/
|
||||
public static DogAllOf fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, DogAllOf.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of DogAllOf to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
@@ -49,6 +50,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.openapitools.client.JSON;
|
||||
|
||||
/**
|
||||
* Drawing
|
||||
*/
|
||||
@@ -229,6 +232,7 @@ public class Drawing extends HashMap<String, Fruit> {
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
|
||||
|
||||
public static HashSet<String> openapiFields;
|
||||
public static HashSet<String> openapiRequiredFields;
|
||||
|
||||
@@ -244,6 +248,48 @@ public class Drawing extends HashMap<String, Fruit> {
|
||||
openapiRequiredFields = new HashSet<String>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates the JSON Object and throws an exception if issues found
|
||||
*
|
||||
* @param jsonObj JSON Object
|
||||
* @throws IOException if the JSON Object is invalid with respect to Drawing
|
||||
*/
|
||||
public static void validateJsonObject(JsonObject jsonObj) throws IOException {
|
||||
if (jsonObj == null) {
|
||||
if (Drawing.openapiRequiredFields.isEmpty()) {
|
||||
return;
|
||||
} else { // has reuqired fields
|
||||
throw new IllegalArgumentException(String.format("The required field(s) %s in Drawing is not found in the empty JSON string", Drawing.openapiRequiredFields.toString()));
|
||||
}
|
||||
}
|
||||
Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry : entries) {
|
||||
if (!Drawing.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Drawing` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
|
||||
}
|
||||
}
|
||||
// validate the optional field `mainShape`
|
||||
if (jsonObj.getAsJsonObject("mainShape") != null) {
|
||||
Shape.validateJsonObject(jsonObj.getAsJsonObject("mainShape"));
|
||||
}
|
||||
// validate the optional field `shapeOrNull`
|
||||
if (jsonObj.getAsJsonObject("shapeOrNull") != null) {
|
||||
ShapeOrNull.validateJsonObject(jsonObj.getAsJsonObject("shapeOrNull"));
|
||||
}
|
||||
// validate the optional field `nullableShape`
|
||||
if (jsonObj.getAsJsonObject("nullableShape") != null) {
|
||||
NullableShape.validateJsonObject(jsonObj.getAsJsonObject("nullableShape"));
|
||||
}
|
||||
JsonArray jsonArrayshapes = jsonObj.getAsJsonArray("shapes");
|
||||
// validate the optional field `shapes` (array)
|
||||
if (jsonArrayshapes != null) {
|
||||
for (int i = 0; i < jsonArrayshapes.size(); i++) {
|
||||
Shape.validateJsonObject(jsonArrayshapes.get(i).getAsJsonObject());
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@@ -264,19 +310,33 @@ public class Drawing extends HashMap<String, Fruit> {
|
||||
|
||||
@Override
|
||||
public Drawing read(JsonReader in) throws IOException {
|
||||
JsonObject obj = elementAdapter.read(in).getAsJsonObject();
|
||||
Set<Entry<String, JsonElement>> entries = obj.entrySet();//will return members of your object
|
||||
// check to see if the JSON string contains additional fields
|
||||
for (Entry<String, JsonElement> entry: entries) {
|
||||
if (!Drawing.openapiFields.contains(entry.getKey())) {
|
||||
throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Drawing` properties");
|
||||
}
|
||||
}
|
||||
|
||||
return thisAdapter.fromJsonTree(obj);
|
||||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
|
||||
validateJsonObject(jsonObj);
|
||||
return thisAdapter.fromJsonTree(jsonObj);
|
||||
}
|
||||
|
||||
}.nullSafe();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of Drawing given an JSON string
|
||||
*
|
||||
* @param jsonString JSON string
|
||||
* @return An instance of Drawing
|
||||
* @throws IOException if the JSON string is invalid with respect to Drawing
|
||||
*/
|
||||
public static Drawing fromJson(String jsonString) throws IOException {
|
||||
return JSON.getGson().fromJson(jsonString, Drawing.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an instance of Drawing to an JSON string
|
||||
*
|
||||
* @return JSON string
|
||||
*/
|
||||
public String toJson() {
|
||||
return JSON.getGson().toJson(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user