mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
[python-flask] deference parameter schemas before further processing (#18605)
* update samples * deref parameter, add null check * Revert "update samples" This reverts commit 2377d98de3b38a105fc970e8a97282fafb8a48ad.
This commit is contained in:
@@ -408,8 +408,14 @@ public abstract class AbstractPythonConnexionServerCodegen extends AbstractPytho
|
||||
}
|
||||
if (operation.getParameters() != null) {
|
||||
for (Parameter parameter : operation.getParameters()) {
|
||||
if (StringUtils.isNotEmpty(parameter.get$ref())) {
|
||||
parameter = ModelUtils.getReferencedParameter(openAPI, parameter);
|
||||
}
|
||||
String swaggerParameterName = parameter.getName();
|
||||
String pythonParameterName = this.toParamName(swaggerParameterName);
|
||||
if (swaggerParameterName == null) {
|
||||
throw new RuntimeException("Please report the issue as the parameter name cannot be null: " + parameter);
|
||||
}
|
||||
if (!swaggerParameterName.equals(pythonParameterName)) {
|
||||
LOGGER.warn(
|
||||
"Parameter name '{}' is not consistent with Python variable names. It will be replaced by '{}'",
|
||||
|
||||
Reference in New Issue
Block a user