mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[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:
parent
53f1094765
commit
fa2b5750ce
@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -824,9 +824,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
return formatDate((Date) param);
|
||||
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} {{/jsr310}}else if (param instanceof Collection) {
|
||||
} {{/jsr310}}else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -852,9 +852,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -191,9 +191,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -210,7 +210,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -230,7 +230,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
// 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}}() {
|
||||
super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
|
||||
@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return {{classname}}.schemas;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
// 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}}() {
|
||||
super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
|
||||
@ -218,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return {{classname}}.schemas;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -824,9 +824,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
return formatDate((Date) param);
|
||||
} {{#jsr310}}else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} {{/jsr310}}else if (param instanceof Collection) {
|
||||
} {{/jsr310}}else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -852,9 +852,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -191,9 +191,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -210,7 +210,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -230,7 +230,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
// 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}}() {
|
||||
super("anyOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
|
||||
@ -144,7 +144,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return {{classname}}.schemas;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
// 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}}() {
|
||||
super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}});
|
||||
@ -218,7 +218,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return {{classname}}.schemas;
|
||||
}
|
||||
|
||||
|
@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -135,7 +135,7 @@ public class Example extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -160,7 +160,7 @@ public class Example extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Example.schemas;
|
||||
}
|
||||
|
||||
|
@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -135,7 +135,7 @@ public class Example extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -156,7 +156,7 @@ public class Example extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Example.schemas;
|
||||
}
|
||||
|
||||
|
@ -733,9 +733,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -761,9 +761,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -733,9 +733,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -761,9 +761,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -815,9 +815,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -843,9 +843,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -144,7 +144,7 @@ public class Fruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -169,7 +169,7 @@ public class Fruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Fruit.schemas;
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class FruitReq extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
@ -169,7 +169,7 @@ public class FruitReq extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return FruitReq.schemas;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ public class GmFruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
@ -149,7 +149,7 @@ public class GmFruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return GmFruit.schemas;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class Mammal extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -275,7 +275,7 @@ public class Mammal extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Mammal.schemas;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
@ -240,7 +240,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return MammalAnyof.schemas;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class NullableShape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
@ -246,7 +246,7 @@ public class NullableShape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return NullableShape.schemas;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class Pig extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -246,7 +246,7 @@ public class Pig extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Pig.schemas;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -246,7 +246,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Quadrilateral.schemas;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class Shape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -246,7 +246,7 @@ public class Shape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Shape.schemas;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
@ -246,7 +246,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return ShapeOrNull.schemas;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class Triangle extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -275,7 +275,7 @@ public class Triangle extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Triangle.schemas;
|
||||
}
|
||||
|
||||
|
@ -641,9 +641,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -669,9 +669,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -178,9 +178,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -197,7 +197,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -217,7 +217,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -592,9 +592,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -620,9 +620,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -717,9 +717,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -745,9 +745,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -717,9 +717,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -745,9 +745,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -815,9 +815,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
return formatDate((Date) param);
|
||||
} else if (param instanceof OffsetDateTime) {
|
||||
return formatOffsetDateTime((OffsetDateTime) param);
|
||||
} else if (param instanceof Collection) {
|
||||
} else if (param instanceof Collection<?>) {
|
||||
StringBuilder b = new StringBuilder();
|
||||
for(Object o : (Collection)param) {
|
||||
for(Object o : (Collection<?>)param) {
|
||||
if(b.length() > 0) {
|
||||
b.append(',');
|
||||
}
|
||||
@ -843,9 +843,9 @@ public class ApiClient extends JavaTimeFormatter {
|
||||
// preconditions
|
||||
if (name == null || name.isEmpty() || value == null) return params;
|
||||
|
||||
Collection valueCollection;
|
||||
if (value instanceof Collection) {
|
||||
valueCollection = (Collection) value;
|
||||
Collection<?> valueCollection;
|
||||
if (value instanceof Collection<?>) {
|
||||
valueCollection = (Collection<?>) value;
|
||||
} else {
|
||||
params.add(new Pair(name, parameterToString(value)));
|
||||
return params;
|
||||
|
@ -179,9 +179,9 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
visitedClasses.add(modelClass);
|
||||
|
||||
// Traverse the oneOf/anyOf composed schemas.
|
||||
Map<String, GenericType> descendants = modelDescendants.get(modelClass);
|
||||
Map<String, GenericType<?>> descendants = modelDescendants.get(modelClass);
|
||||
if (descendants != null) {
|
||||
for (GenericType childType : descendants.values()) {
|
||||
for (GenericType<?> childType : descendants.values()) {
|
||||
if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) {
|
||||
return true;
|
||||
}
|
||||
@ -198,7 +198,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
/**
|
||||
* 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.
|
||||
@ -218,7 +218,7 @@ public class JSON implements ContextResolver<ObjectMapper> {
|
||||
* @param modelClass the model class
|
||||
* @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);
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public abstract class AbstractOpenApiSchema {
|
||||
*
|
||||
* @return an instance of the actual schema/object
|
||||
*/
|
||||
public abstract Map<String, GenericType> getSchemas();
|
||||
public abstract Map<String, GenericType<?>> getSchemas();
|
||||
|
||||
/**
|
||||
* Get the actual instance
|
||||
|
@ -142,7 +142,7 @@ public class Fruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -167,7 +167,7 @@ public class Fruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Fruit.schemas;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class FruitReq extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
@ -167,7 +167,7 @@ public class FruitReq extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return FruitReq.schemas;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class GmFruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
@ -147,7 +147,7 @@ public class GmFruit extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return GmFruit.schemas;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ public class Mammal extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -273,7 +273,7 @@ public class Mammal extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Mammal.schemas;
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("anyOf", Boolean.FALSE);
|
||||
@ -238,7 +238,7 @@ public class MammalAnyof extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return MammalAnyof.schemas;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class NullableShape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
@ -244,7 +244,7 @@ public class NullableShape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return NullableShape.schemas;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class Pig extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -244,7 +244,7 @@ public class Pig extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Pig.schemas;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -244,7 +244,7 @@ public class Quadrilateral extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Quadrilateral.schemas;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class Shape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -244,7 +244,7 @@ public class Shape extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Shape.schemas;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.TRUE);
|
||||
@ -244,7 +244,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return ShapeOrNull.schemas;
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ public class Triangle extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
// 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() {
|
||||
super("oneOf", Boolean.FALSE);
|
||||
@ -273,7 +273,7 @@ public class Triangle extends AbstractOpenApiSchema {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, GenericType> getSchemas() {
|
||||
public Map<String, GenericType<?>> getSchemas() {
|
||||
return Triangle.schemas;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user