Repository navigation
chore: openapi-client turns on client request validation - #96
Merged
Merged
Conversation
The rest-openapi client now validates each request against the contract
before sending it (camel.component.rest-openapi.request-validation-enabled
in application.properties): a call without a value for a path parameter, a
required header or query parameter, or a required body is refused with a
message naming what is missing, instead of going out with {sku} in the path.
The path parameter check is CAMEL-25321 (Camel 4.23). The README's "Try
changing" no longer claims that a reservation without qty is refused (the
validation does not check the body against the schema).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
davsclaus
added a commit
to apache/camel
that referenced
this pull request
Oct 4, 2026
…on client request validation Synced with the sync-example-catalog profile after apache/camel-jbang-examples#96: camel.component.rest-openapi.request-validation-enabled=true in the example's application.properties, so a call without a value for a path parameter fails before it is sent (CAMEL-25321), and the README explains it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The openapi-client example now turns on client request validation for rest-openapi:
camel.component.rest-openapi.request-validation-enabled=trueA call without a value for a path parameter, a required header or query parameter, or a required body is now refused before it is sent, with a message that names what is missing. Before, it went out with the literal
{sku}in the path and got a 404. The path-parameter check is new in Camel 4.23 (CAMEL-25321, apache/camel#27333). On 4.22 the validation is on but doesn't check path parameters, and the example runs the same.Why: in the local-model benchmark, the openapi-client example with this option on sent 0 requests with
{sku}in the path, against 942 without it. The model got "Path parameter 'sku' is required but none found: set the header sku, or an exchange variable of that name, before the call." instead.README:
qty: the client refuses it"), which wasn't true: the validation checks that a body is there and parses, not its fields against the schema. The new bullet removes theskuheader and shows the path-parameter message.Checked by hand against the openapi-server example on 4.23.0-SNAPSHOT:
skuheader removed, every call is refused with the path-parameter message, and no request is sent.The Citrus test runner (
camel test run) failed to start on this machine (a JUnit launcher class missing in the plugin's classpath), so CI here is the test run.🤖 Generated with Claude Code
https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m