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

CAMEL-20763: camel-support Handle special characters in REST templates #14145

Merged
merged 1 commit into from
May 15, 2024

Conversation

driseley
Copy link
Contributor

Description

Ensure that any hypens or underscores in parameters in REST templates are removed before being parsed into a regular expression

The code will remove (using a regular expression match) any hyphens or underscores in REST template parameter names. This is required as the parameter name are parsed into regular expression named groups which support only letters and numbers as group names.

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).

https://issues.apache.org/jira/browse/CAMEL-20763

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 and I have committed all auto-generated changes

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.

@driseley
Copy link
Contributor Author

If this is accepted could it also be backported to the 4.4.x LTS release? As this was introduced in 4.2.0 - it is not required on the 4.0.x LTS release

@davsclaus
Copy link
Contributor

org.apache.camel.support.RestConsumerContextPathMatcherTest.testRestConsumerContextPathMatcherOrder 0.028s ERROR
org.apache.camel.support.RestConsumerContextPathMatcherTest.testRestConsumerContextPathMatcherWithWildcard 0.002s ERROR

Copy link
Contributor

@davsclaus davsclaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit test errors - please do full test of camel-core before sending PR next time

Ensure that any hypens or underscores in parameters in REST templates
are removed before being parsed into a regular expression
@driseley
Copy link
Contributor Author

Apologies I thought I had run the tests, clearly I had not. That's fixed now and should pass

@davsclaus davsclaus merged commit 66610ae into apache:main May 15, 2024
4 checks passed
davsclaus pushed a commit that referenced this pull request May 15, 2024
#14145)

Ensure that any hypens or underscores in parameters in REST templates
are removed before being parsed into a regular expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants