You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "stklcode (via GitHub)" <gi...@apache.org> on 2024/05/02 16:27:15 UTC
[PR] CAMEL-20732: fix parsing primitive array types in RestDefinition [camel]
stklcode opened a new pull request, #14043:
URL: https://github.com/apache/camel/pull/14043
# Description
Generation of string representation for arrays relies on getName() as a workaround to properly support nested classes. However, this results in "null[]" for array of primitives.
```java
package my.example;
public class MyRoutes extends org.apache.camel.builder.RouteBuilder {
@Override
public void configure() throws Exception {
rest()
.get("/test")
.outType(byte[].class) // <-- this is the problematic argument
.produces("application/octet-stream")
.route()
.log("test me");
}
}
```
The problem is that `asTypeName(byte[].class)` returns `"null[]"` before this fix, because `byte[].class.getName()` equals `"[B"` and the logic is looking for `"[L...;"` only.
Rework (and simplify) the logic and introduce a unit test, so we can handle such types properly again.
# Target
- [x] 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
- [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
# Apache Camel coding standards and style
- [x] I checked that each commit in the pull request has a meaningful subject line and body.
- [x] I have run `mvn clean install -DskipTests` locally and I have committed all auto-generated changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20732: fix parsing primitive array types in RestDefinition [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #14043:
URL: https://github.com/apache/camel/pull/14043
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20732: fix parsing primitive array types in RestDefinition [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14043:
URL: https://github.com/apache/camel/pull/14043#issuecomment-2090972366
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: 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](https://camel.apache.org/community/team/#committers) have access to the summary.
* :warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org