This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-3.14.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.14.x by this push: new a477579 CAMEL-17430 Add endpoint parameters if operation parameters is null (#6639) a477579 is described below commit a477579264e8bd092221d69c2c4ad4fc95cf20f9 Author: henka-rl <67908385+henka...@users.noreply.github.com> AuthorDate: Wed Jan 5 07:09:02 2022 +0100 CAMEL-17430 Add endpoint parameters if operation parameters is null (#6639) --- .../component/rest/openapi/RestOpenApiEndpoint.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java b/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java index 17b6d1e..6836bde 100644 --- a/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java +++ b/components/camel-rest-openapi/src/main/java/org/apache/camel/component/rest/openapi/RestOpenApiEndpoint.java @@ -530,16 +530,20 @@ public final class RestOpenApiEndpoint extends DefaultEndpoint { } // Add rest endpoint parameters - if (this.parameters != null && operation.getParameters() != null) { - for (Map.Entry<String, Object> entry : this.parameters.entrySet()) { - for (OasParameter param : operation.getParameters()) { - // skip parameters that are part of the operation as path as otherwise - // it will be duplicated as query parameter as well - boolean clash = "path".equals(param.in) && entry.getKey().equals(param.getName()); - if (!clash) { - nestedParameters.put(entry.getKey(), entry.getValue()); + if (this.parameters != null) { + if (operation.getParameters() != null) { + for (Map.Entry<String, Object> entry : this.parameters.entrySet()) { + for (OasParameter param : operation.getParameters()) { + // skip parameters that are part of the operation as path as otherwise + // it will be duplicated as query parameter as well + boolean clash = "path".equals(param.in) && entry.getKey().equals(param.getName()); + if (!clash) { + nestedParameters.put(entry.getKey(), entry.getValue()); + } } } + } else { + nestedParameters.putAll(this.parameters); } }