davsclaus opened a new pull request, #96:
URL: https://github.com/apache/camel-jbang-examples/pull/96

   The openapi-client example now turns on client request validation for 
rest-openapi:
   
   ```properties
   camel.component.rest-openapi.request-validation-enabled=true
   ```
   
   A 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:**
   - "How it works" explains the validation.
   - "Try changing" replaces the old bullet ("send a reservation without `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 
the `sku` header and shows the path-parameter message.
   
   **Checked by hand** against the openapi-server example on 4.23.0-SNAPSHOT:
   - The orders reserve as before, including the expected 409 for CAMEL-CAP.
   - With the `sku` header 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.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


-- 
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]

Reply via email to