[Bug] [Java] Remove raw type compilation warnings when generating using jersey2 or jersey3 (#19033)

* Add type annotations to raw types for jersey2 and jersey3 templates

* Update samples

* Add type parameters to anyof_model.mustache and oneof_model.mustache

---------

Co-authored-by: Kasper S. Nielsen <kasper.s.nielsen@secata.com>
This commit is contained in:
ksn-partisia 2024-06-30 04:06:12 +02:00 committed by GitHub
parent 53f1094765
commit fa2b5750ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
64 changed files with 176 additions and 176 deletions

View File

@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -824,9 +824,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
return formatDate((Date) param); return formatDate((Date) param);
} {{#jsr310}}else if (param instanceof OffsetDateTime) { } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} {{/jsr310}}else if (param instanceof Collection) { } {{/jsr310}}else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -852,9 +852,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -191,9 +191,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -210,7 +210,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -230,7 +230,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
// store a list of schema names defined in anyOf // store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public {{classname}}() { public {{classname}}() {
super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return {{classname}}.schemas; return {{classname}}.schemas;
} }

View File

@ -169,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public {{classname}}() { public {{classname}}() {
super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
@ -218,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return {{classname}}.schemas; return {{classname}}.schemas;
} }

View File

@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -824,9 +824,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
return formatDate((Date) param); return formatDate((Date) param);
} {{#jsr310}}else if (param instanceof OffsetDateTime) { } {{#jsr310}}else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} {{/jsr310}}else if (param instanceof Collection) { } {{/jsr310}}else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -852,9 +852,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -191,9 +191,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -210,7 +210,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -230,7 +230,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
// store a list of schema names defined in anyOf // store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public {{classname}}() { public {{classname}}() {
super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return {{classname}}.schemas; return {{classname}}.schemas;
} }

View File

@ -169,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public {{classname}}() { public {{classname}}() {
super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
@ -218,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return {{classname}}.schemas; return {{classname}}.schemas;
} }

View File

@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -135,7 +135,7 @@ public class Example extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Example() { public Example() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -160,7 +160,7 @@ public class Example extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Example.schemas; return Example.schemas;
} }

View File

@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -135,7 +135,7 @@ public class Example extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Example() { public Example() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -156,7 +156,7 @@ public class Example extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Example.schemas; return Example.schemas;
} }

View File

@ -733,9 +733,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -761,9 +761,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -733,9 +733,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -761,9 +761,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -815,9 +815,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -843,9 +843,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -144,7 +144,7 @@ public class Fruit extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Fruit() { public Fruit() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -169,7 +169,7 @@ public class Fruit extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Fruit.schemas; return Fruit.schemas;
} }

View File

@ -144,7 +144,7 @@ public class FruitReq extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public FruitReq() { public FruitReq() {
super("oneOf", Boolean.TRUE); super("oneOf", Boolean.TRUE);
@ -169,7 +169,7 @@ public class FruitReq extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return FruitReq.schemas; return FruitReq.schemas;
} }

View File

@ -124,7 +124,7 @@ public class GmFruit extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in anyOf // store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public GmFruit() { public GmFruit() {
super("anyOf", Boolean.FALSE); super("anyOf", Boolean.FALSE);
@ -149,7 +149,7 @@ public class GmFruit extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return GmFruit.schemas; return GmFruit.schemas;
} }

View File

@ -187,7 +187,7 @@ public class Mammal extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Mammal() { public Mammal() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -275,7 +275,7 @@ public class Mammal extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Mammal.schemas; return Mammal.schemas;
} }

View File

@ -152,7 +152,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in anyOf // store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public MammalAnyof() { public MammalAnyof() {
super("anyOf", Boolean.FALSE); super("anyOf", Boolean.FALSE);
@ -240,7 +240,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return MammalAnyof.schemas; return MammalAnyof.schemas;
} }

View File

@ -166,7 +166,7 @@ public class NullableShape extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public NullableShape() { public NullableShape() {
super("oneOf", Boolean.TRUE); super("oneOf", Boolean.TRUE);
@ -246,7 +246,7 @@ public class NullableShape extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return NullableShape.schemas; return NullableShape.schemas;
} }

View File

@ -166,7 +166,7 @@ public class Pig extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Pig() { public Pig() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -246,7 +246,7 @@ public class Pig extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Pig.schemas; return Pig.schemas;
} }

View File

@ -166,7 +166,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Quadrilateral() { public Quadrilateral() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -246,7 +246,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Quadrilateral.schemas; return Quadrilateral.schemas;
} }

View File

@ -166,7 +166,7 @@ public class Shape extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Shape() { public Shape() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -246,7 +246,7 @@ public class Shape extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Shape.schemas; return Shape.schemas;
} }

View File

@ -166,7 +166,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public ShapeOrNull() { public ShapeOrNull() {
super("oneOf", Boolean.TRUE); super("oneOf", Boolean.TRUE);
@ -246,7 +246,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return ShapeOrNull.schemas; return ShapeOrNull.schemas;
} }

View File

@ -187,7 +187,7 @@ public class Triangle extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Triangle() { public Triangle() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -275,7 +275,7 @@ public class Triangle extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Triangle.schemas; return Triangle.schemas;
} }

View File

@ -641,9 +641,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -669,9 +669,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -178,9 +178,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -197,7 +197,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -217,7 +217,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -717,9 +717,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -745,9 +745,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -717,9 +717,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -745,9 +745,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -815,9 +815,9 @@ public class ApiClient extends JavaTimeFormatter {
return formatDate((Date) param); return formatDate((Date) param);
} else if (param instanceof OffsetDateTime) { } else if (param instanceof OffsetDateTime) {
return formatOffsetDateTime((OffsetDateTime) param); return formatOffsetDateTime((OffsetDateTime) param);
} else if (param instanceof Collection) { } else if (param instanceof Collection<?>) {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
for(Object o : (Collection)param) { for(Object o : (Collection<?>)param) {
if(b.length() > 0) { if(b.length() > 0) {
b.append(','); b.append(',');
} }
@ -843,9 +843,9 @@ public class ApiClient extends JavaTimeFormatter {
// preconditions // preconditions
if (name == null || name.isEmpty() || value == null) return params; if (name == null || name.isEmpty() || value == null) return params;
Collection valueCollection; Collection<?> valueCollection;
if (value instanceof Collection) { if (value instanceof Collection<?>) {
valueCollection = (Collection) value; valueCollection = (Collection<?>) value;
} else { } else {
params.add(new Pair(name, parameterToString(value))); params.add(new Pair(name, parameterToString(value)));
return params; return params;

View File

@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
visitedClasses.add(modelClass); visitedClasses.add(modelClass);
// Traverse the oneOf/anyOf composed schemas. // Traverse the oneOf/anyOf composed schemas.
Map<String, GenericType> descendants = modelDescendants.get(modelClass); Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
if (descendants != null) { if (descendants != null) {
for (GenericType childType : descendants.values()) { for (GenericType<?> childType : descendants.values()) {
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
return true; return true;
} }
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
/** /**
* A map of oneOf/anyOf descendants for each model class. * A map of oneOf/anyOf descendants for each model class.
*/ */
private static Map<Class<?>, Map<String, GenericType>> modelDescendants = new HashMap<>(); private static Map<Class<?>, Map<String, GenericType<?>>> modelDescendants = new HashMap<>();
/** /**
* Register a model class discriminator. * Register a model class discriminator.
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
* @param modelClass the model class * @param modelClass the model class
* @param descendants a map of oneOf/anyOf descendants. * @param descendants a map of oneOf/anyOf descendants.
*/ */
public static void registerDescendants(Class<?> modelClass, Map<String, GenericType> descendants) { public static void registerDescendants(Class<?> modelClass, Map<String, GenericType<?>> descendants) {
modelDescendants.put(modelClass, descendants); modelDescendants.put(modelClass, descendants);
} }

View File

@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
* *
* @return an instance of the actual schema/object * @return an instance of the actual schema/object
*/ */
public abstract Map<String, GenericType> getSchemas(); public abstract Map<String, GenericType<?>> getSchemas();
/** /**
* Get the actual instance * Get the actual instance

View File

@ -142,7 +142,7 @@ public class Fruit extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Fruit() { public Fruit() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -167,7 +167,7 @@ public class Fruit extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Fruit.schemas; return Fruit.schemas;
} }

View File

@ -142,7 +142,7 @@ public class FruitReq extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public FruitReq() { public FruitReq() {
super("oneOf", Boolean.TRUE); super("oneOf", Boolean.TRUE);
@ -167,7 +167,7 @@ public class FruitReq extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return FruitReq.schemas; return FruitReq.schemas;
} }

View File

@ -122,7 +122,7 @@ public class GmFruit extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in anyOf // store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public GmFruit() { public GmFruit() {
super("anyOf", Boolean.FALSE); super("anyOf", Boolean.FALSE);
@ -147,7 +147,7 @@ public class GmFruit extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return GmFruit.schemas; return GmFruit.schemas;
} }

View File

@ -185,7 +185,7 @@ public class Mammal extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Mammal() { public Mammal() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -273,7 +273,7 @@ public class Mammal extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Mammal.schemas; return Mammal.schemas;
} }

View File

@ -150,7 +150,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in anyOf // store a list of schema names defined in anyOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public MammalAnyof() { public MammalAnyof() {
super("anyOf", Boolean.FALSE); super("anyOf", Boolean.FALSE);
@ -238,7 +238,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return MammalAnyof.schemas; return MammalAnyof.schemas;
} }

View File

@ -164,7 +164,7 @@ public class NullableShape extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public NullableShape() { public NullableShape() {
super("oneOf", Boolean.TRUE); super("oneOf", Boolean.TRUE);
@ -244,7 +244,7 @@ public class NullableShape extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return NullableShape.schemas; return NullableShape.schemas;
} }

View File

@ -164,7 +164,7 @@ public class Pig extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Pig() { public Pig() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -244,7 +244,7 @@ public class Pig extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Pig.schemas; return Pig.schemas;
} }

View File

@ -164,7 +164,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Quadrilateral() { public Quadrilateral() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -244,7 +244,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Quadrilateral.schemas; return Quadrilateral.schemas;
} }

View File

@ -164,7 +164,7 @@ public class Shape extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Shape() { public Shape() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -244,7 +244,7 @@ public class Shape extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Shape.schemas; return Shape.schemas;
} }

View File

@ -164,7 +164,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public ShapeOrNull() { public ShapeOrNull() {
super("oneOf", Boolean.TRUE); super("oneOf", Boolean.TRUE);
@ -244,7 +244,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return ShapeOrNull.schemas; return ShapeOrNull.schemas;
} }

View File

@ -185,7 +185,7 @@ public class Triangle extends AbstractOpenApiSchema {
} }
// store a list of schema names defined in oneOf // store a list of schema names defined in oneOf
public static final Map<String, GenericType> schemas = new HashMap<>(); public static final Map<String, GenericType<?>> schemas = new HashMap<>();
public Triangle() { public Triangle() {
super("oneOf", Boolean.FALSE); super("oneOf", Boolean.FALSE);
@ -273,7 +273,7 @@ public class Triangle extends AbstractOpenApiSchema {
} }
@Override @Override
public Map<String, GenericType> getSchemas() { public Map<String, GenericType<?>> getSchemas() {
return Triangle.schemas; return Triangle.schemas;
} }