davsclaus opened a new pull request, #3317:
URL: https://github.com/apache/camel-kamelets/pull/3317
Closes #3250.
**Stacked on #3316.** Until #3316 merges, this branch also carries its
commit. The change of this PR is only the last commit. After #3316 merges, I'll
rebase this branch onto `main`.
## What it does
`CatalogValidator` (`library/kamelets-maven-plugin`) now fails the build for
a Kamelet that does not declare `spec.dataTypes` for its own side:
| Kamelet type | Must declare |
|---|---|
| source | `dataTypes.out` |
| sink | `dataTypes.in` |
| action | `dataTypes.in` and `dataTypes.out` |
An empty `headers: {}` counts as declared, as the issue proposes. The
comment that says why there is no `default` is a convention: the YAML parser
cannot see comments. #3316 adds one to every side without a default.
The error reads:
```
kamelet "http-sink" does not declare spec.dataTypes.in: declare what it
takes, or an empty "headers: {}" with a comment that says why it has no default
```
The new section of `development.adoc`, "Declaring headers without a
transformation", describes the rule with an example.
## Tests
- 6 new tests in `CatalogValidatorTest`: a source with no `dataTypes`, a
source with only an empty `headers: {}`, a sink that declares only `out`, a
sink with a default, an action with one side or none, and a side with no value.
16/16 pass.
- I took the `dataTypes` block out of `http-sink` (on a scratch copy) and
ran the build. It fails with the error above. With the block back, the build
passes.
- `./mvnw -o clean install -DskipITs`: BUILD SUCCESS.
There is no upgrade note: this changes only the build of the catalog.
_Claude Code on behalf of Claus Ibsen_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016Y4dDmBDsSWV117kccuNf9
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]