Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 4.8.x] Fix for RestOpenApiProcessor for parsing path variables from the http… #16346

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

squakez
Copy link
Contributor

@squakez squakez commented Nov 21, 2024

… request uri succesfully. (#16220)

  • Update RestOpenApiProcessor.java

if uri is not starting with slash then remove the slash in the consumerPath from the openApi spec, because if there is any path variables (/../{id}) in the consumerPath and the uri does not start with "/" then HttpHelper.evalPlaceholders method throws an ArrayIndexOutOfBoundsException.

  • code style fixes and added null check the uri.

Description

Target

  • I checked that the commit is targeting the correct branch (note that Camel 3 uses camel-3.x, whereas Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

… request uri succesfully. (apache#16220)

* Update RestOpenApiProcessor.java

if uri is not starting with slash then remove the slash in the consumerPath from the openApi spec, because if there is any path variables (/../{id}) in the consumerPath and the uri does not start with "/" then  HttpHelper.evalPlaceholders method throws an ArrayIndexOutOfBoundsException.

* code style fixes and added null check the uri.
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟

🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run

  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot.

  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.

  • Build and test logs are available in the Summary page. Only Apache Camel committers have access to the summary.

  • ⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@squakez
Copy link
Contributor Author

squakez commented Nov 22, 2024

There are tests failure in Camel JBang plugins which are not related to this PR. @oscerd is it fine to merge anyway given the problems are not within this PR? not sure the policy we're adapting here in the core. Thanks.

@oscerd oscerd merged commit 1385c8f into apache:camel-4.8.x Nov 22, 2024
4 of 5 checks passed
@squakez squakez deleted the backport/rest_fix branch November 22, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rest "contract first" fails with variable in api path
3 participants