Skip to content

Commit

Permalink
[python-flask] deference parameter schemas before further processing (#…
Browse files Browse the repository at this point in the history
…18605)

* update samples

* deref parameter, add null check

* Revert "update samples"

This reverts commit 2377d98.
  • Loading branch information
wing328 authored May 8, 2024
1 parent 9db0e32 commit 8226ff8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,14 @@ public void preprocessOpenAPI(OpenAPI openAPI) {
}
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 '{}'",
Expand Down

0 comments on commit 8226ff8

Please # to comment.