Improved: Update build.gradle to the latest dependencies (OFBIZ-12658)
I handled <<addProperties(String,Schema) in Schema has been deprecated>> Just needed to replace by addProperty(String,Schema) for each case
This commit is contained in:
@@ -27,9 +27,9 @@ dependencies {
|
||||
pluginLibsCompile 'org.glassfish.jersey.media:jersey-media-multipart:2.31'
|
||||
pluginLibsCompile 'org.glassfish.jersey.media:jersey-media-json-jackson:2.31'
|
||||
pluginLibsCompile 'org.glassfish.jersey.inject:jersey-hk2:2.31'
|
||||
pluginLibsCompile 'io.swagger.core.v3:swagger-jaxrs2:2.1.10'
|
||||
pluginLibsCompile 'io.swagger.core.v3:swagger-jaxrs2-servlet-initializer:2.1.10'
|
||||
pluginLibsCompile 'io.swagger.core.v3:swagger-annotations:2.1.10'
|
||||
pluginLibsCompile 'io.swagger.core.v3:swagger-jaxrs2:2.2.1'
|
||||
pluginLibsCompile 'io.swagger.core.v3:swagger-jaxrs2-servlet-initializer:2.2.1'
|
||||
pluginLibsCompile 'io.swagger.core.v3:swagger-annotations:2.2.1'
|
||||
}
|
||||
|
||||
task install {
|
||||
|
||||
@@ -159,10 +159,12 @@ public final class OpenApiUtil {
|
||||
}
|
||||
|
||||
private static void buildApiResponseSchemas() {
|
||||
Schema<?> genericErrorSchema = new MapSchema().addProperties("statusCode", new IntegerSchema().description("HTTP Status Code"))
|
||||
.addProperties("statusDescription", new StringSchema().description("HTTP Status Code Description"))
|
||||
.addProperties("errorType", new StringSchema().description("Error Type for the error"))
|
||||
.addProperties("errorMessage", new StringSchema().description("Error Message"));
|
||||
Schema<?> genericErrorSchema = new MapSchema();
|
||||
genericErrorSchema.addProperty("statusCode", new IntegerSchema().description("HTTP Status Code"));
|
||||
|
||||
genericErrorSchema.addProperty("statusDescription", new StringSchema().description("HTTP Status Code Description"));
|
||||
genericErrorSchema.addProperty("errorType", new StringSchema().description("Error Type for the error"));
|
||||
genericErrorSchema.addProperty("errorMessage", new StringSchema().description("Error Message"));
|
||||
SCHEMAS.put("api.response.unauthorized.noheader", genericErrorSchema);
|
||||
SCHEMAS.put("api.response.unauthorized.invalidtoken", genericErrorSchema);
|
||||
SCHEMAS.put("api.response.forbidden", genericErrorSchema);
|
||||
@@ -283,7 +285,7 @@ public final class OpenApiUtil {
|
||||
}
|
||||
Schema<?> attrSchema = getAttributeSchema(service, param);
|
||||
if (attrSchema != null) {
|
||||
parentSchema.addProperties(name, getAttributeSchema(service, service.getParam(name)));
|
||||
parentSchema.addProperty(name, getAttributeSchema(service, service.getParam(name)));
|
||||
}
|
||||
});
|
||||
parentSchema.setRequired(required);
|
||||
@@ -333,7 +335,7 @@ public final class OpenApiUtil {
|
||||
if (!param.isOptional()) {
|
||||
required.add(childParam.getName());
|
||||
}
|
||||
schema.addProperties(childParam.getName(), getAttributeSchema(service, childParam));
|
||||
schema.addProperty(childParam.getName(), getAttributeSchema(service, childParam));
|
||||
}
|
||||
schema.setRequired(required);
|
||||
}
|
||||
@@ -346,15 +348,15 @@ public final class OpenApiUtil {
|
||||
Schema<Object> parentSchema = new Schema<Object>();
|
||||
parentSchema.setDescription("Out Schema for service: " + service.getName() + " response");
|
||||
parentSchema.setType("object");
|
||||
parentSchema.addProperties("statusCode", new IntegerSchema().description("HTTP Status Code"));
|
||||
parentSchema.addProperties("statusDescription", new StringSchema().description("HTTP Status Code Description"));
|
||||
parentSchema.addProperties("successMessage", new StringSchema().description("Success Message"));
|
||||
parentSchema.addProperty("statusCode", new IntegerSchema().description("HTTP Status Code"));
|
||||
parentSchema.addProperty("statusDescription", new StringSchema().description("HTTP Status Code Description"));
|
||||
parentSchema.addProperty("successMessage", new StringSchema().description("Success Message"));
|
||||
Schema<Object> dataSchema = new Schema<Object>();
|
||||
parentSchema.addProperties("data", dataSchema);
|
||||
parentSchema.addProperty("data", dataSchema);
|
||||
service.getOutParamNamesMap().forEach((name, type) -> {
|
||||
Schema<?> attrSchema = getAttributeSchema(service, service.getParam(name));
|
||||
if (attrSchema != null) {
|
||||
dataSchema.addProperties(name, getAttributeSchema(service, service.getParam(name)));
|
||||
dataSchema.addProperty(name, getAttributeSchema(service, service.getParam(name)));
|
||||
}
|
||||
});
|
||||
return parentSchema;
|
||||
@@ -385,7 +387,7 @@ public final class OpenApiUtil {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (schemaClass != null) {
|
||||
dataSchema.addProperties(fieldNm, schema.description(fieldNm));
|
||||
dataSchema.addProperty(fieldNm, schema.description(fieldNm));
|
||||
}
|
||||
}
|
||||
return dataSchema;
|
||||
|
||||
Reference in New Issue
Block a user