forked from loafle/openapi-generator-original
[sonar][ci] Fixes some new recommended "bug" fixes found via Sonar (#7508)
This commit is contained in:
parent
596bbb9c58
commit
49760f7a34
@ -623,6 +623,7 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
|
|||||||
// the OpenAPI 2.0/3.0 specs, which mandates the ISO-8601 full-date or date-time formats. Accordingly, date
|
// the OpenAPI 2.0/3.0 specs, which mandates the ISO-8601 full-date or date-time formats. Accordingly, date
|
||||||
// and date-time fields are annotated with @JsonFormat to specify the appropriate ISO format.
|
// and date-time fields are annotated with @JsonFormat to specify the appropriate ISO format.
|
||||||
if (loadTestDataFromFile) {
|
if (loadTestDataFromFile) {
|
||||||
|
if (var != null) {
|
||||||
Date randomDate = new Date(randomDateLong);
|
Date randomDate = new Date(randomDateLong);
|
||||||
switch (var.dataFormat) {
|
switch (var.dataFormat) {
|
||||||
case "date":
|
case "date":
|
||||||
@ -632,6 +633,7 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
|
|||||||
var.addTestData(ISO8601_DATETIME_FORMAT.get().format(randomDate));
|
var.addTestData(ISO8601_DATETIME_FORMAT.get().format(randomDate));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
buffer.append("new Date(").append(randomDateLong).append(')');
|
buffer.append("new Date(").append(randomDateLong).append(')');
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,7 @@ public class ModelUtils {
|
|||||||
childrenMap = tmpChildrenMap;
|
childrenMap = tmpChildrenMap;
|
||||||
List<String> unusedSchemas = new ArrayList<String>();
|
List<String> unusedSchemas = new ArrayList<String>();
|
||||||
|
|
||||||
|
if (openAPI != null) {
|
||||||
Map<String, Schema> schemas = getSchemas(openAPI);
|
Map<String, Schema> schemas = getSchemas(openAPI);
|
||||||
unusedSchemas.addAll(schemas.keySet());
|
unusedSchemas.addAll(schemas.keySet());
|
||||||
|
|
||||||
@ -184,6 +185,7 @@ public class ModelUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return unusedSchemas;
|
return unusedSchemas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,13 +51,13 @@ module DynamicServers
|
|||||||
form_params = opts[:form_params] || {}
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = opts[:body]
|
post_body = opts[:debug_body]
|
||||||
|
|
||||||
# return_type
|
# return_type
|
||||||
return_type = opts[:return_type] || 'Object'
|
return_type = opts[:debug_return_type] || 'Object'
|
||||||
|
|
||||||
# auth_names
|
# auth_names
|
||||||
auth_names = opts[:auth_names] || []
|
auth_names = opts[:debug_auth_names] || []
|
||||||
|
|
||||||
new_options = opts.merge(
|
new_options = opts.merge(
|
||||||
:operation => :"UsageApi.custom_server",
|
:operation => :"UsageApi.custom_server",
|
||||||
@ -108,13 +108,13 @@ module DynamicServers
|
|||||||
form_params = opts[:form_params] || {}
|
form_params = opts[:form_params] || {}
|
||||||
|
|
||||||
# http body (model)
|
# http body (model)
|
||||||
post_body = opts[:body]
|
post_body = opts[:debug_body]
|
||||||
|
|
||||||
# return_type
|
# return_type
|
||||||
return_type = opts[:return_type] || 'Object'
|
return_type = opts[:debug_return_type] || 'Object'
|
||||||
|
|
||||||
# auth_names
|
# auth_names
|
||||||
auth_names = opts[:auth_names] || []
|
auth_names = opts[:debug_auth_names] || []
|
||||||
|
|
||||||
new_options = opts.merge(
|
new_options = opts.merge(
|
||||||
:operation => :"UsageApi.default_server",
|
:operation => :"UsageApi.default_server",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user