CodeTrainerMan commented on PR #1157:
URL: https://github.com/apache/flink-agents/pull/1157#issuecomment-5878636795

   Thanks for the suggestion, @wenjin272 — agreed, the Java reconstruction 
paths should behave the same as direct construction.
   
   I've moved the check into a shared `validateMaxResults` helper and now call 
it from the `@JsonCreator (id, attributes)` constructor as well. Since 
`Event.reconstructFrom` builds instances through that constructor, both 
reconstruction paths (`fromEvent` and JSON deserialization) are covered in one 
place. The exception type and message are unchanged, so both languages keep 
reporting identical errors for the same input.
   
   Added four tests to `ContextRetrievalRequestEventTest`: reconstruction from 
attributes, reconstruction via `fromEvent`, the valid case, and a missing 
`max_results` attribute (not rejected, to stay compatible with payloads that 
don't set it). The full `api` module suite passes locally (488 tests).
   
   If anything still comes up after this push, I'll dig into it and follow up 
with another commit.


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