Repository navigation
[rust-server] Validate model-valued wrapper fields - #25262
EricLiu2000 wants to merge 1 commit into
Conversation
cfd2856 to
14190f0
Compare
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
14190f0 to
3e3cecb
Compare
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
3e3cecb to
bbde794
Compare
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
bbde794 to
85c4016
Compare
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Signed-off-by: Eric Liu <ericxliu@gmail.com>
85c4016 to
23b7f99
Compare
|
thanks for the PR cc @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) @jacob-pro (2022/10) @dsteeley (2025/07) |
Fixes #25261.
Generated model-valued wrappers derive
Validatewithout marking their inner field for nested validation. A root validation call can therefore miss invalid children. Add nested validation to array, map, and reference wrappers, and keep it on object fields that also have bounds.Model-only union wrappers delegate to the wrapped type's existing
Validateimplementation. Primitive and mixed union wrappers keep their current behavior. Wrapped types remain responsible for their own validation.Array values use
min_itemsandmax_itemsinstead of string-length annotations. Nullable array fields keep their existing bound annotations for compatibility with the released runtime. This change does not add nullable collection-size support or change dependency versions.Validation for
23b7f992:./mvnw -q -pl modules/openapi-generator-cli -am package -Dtest='org.openapitools.codegen.rust.*Test' -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true../bin/generate-samples.sh bin/configs/rust-server*.yaml.recursive-validation.rsincludes the steps to run them; Maven checks generated source but does not execute these Rust tests.cargo check --no-default-features --features client,server,validate --lib.