Fix rust-server client feature deps for pattern validation#24023
Open
scarab-systems wants to merge 1 commit into
Open
Fix rust-server client feature deps for pattern validation#24023scarab-systems wants to merge 1 commit into
scarab-systems wants to merge 1 commit into
Conversation
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.
Fixes #23920.
What changed
lazy_staticandregexto the generatedrust-serverclientfeature whenever generated models can emit pattern validation statics.rust-serversample Cargo manifests.Why
rust-servershared models can emitlazy_static::lazy_static!andregex::Regexfor schemapatternvalidation even when consumers build only theclientfeature. Previously, those dependencies were only added to theclientfeature through the callbacks path, so client-only builds could miss them.Validation
Targeted validation:
./mvnw -pl modules/openapi-generator -am -Dtest=RustServerCodegenTest -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -pl modules/openapi-generator-cli -am package -DskipTests=true -Dmaven.javadoc.skip=true -Djacoco.skip=true./bin/generate-samples.sh ./bin/configs/rust-server-multipart-v3.yaml ./bin/configs/rust-server-no-example-v3.yaml ./bin/configs/rust-server-openapi-v3.yaml ./bin/configs/rust-server-ops-v3.yaml ./bin/configs/rust-server-petstore-with-fake-endpoints-models-for-testing.yaml ./bin/configs/rust-server-ping-bearer-auth-v3.yaml ./bin/configs/rust-server-test.yaml(cd samples/server/petstore/rust-server/output/no-example-v3 && cargo check --no-default-features --features client)Full PR-template sequence:
./mvnw clean package./bin/generate-samples.sh ./bin/configs/*.yaml./bin/utils/export_docs_generators.shThe full sample/doc regeneration completed without additional tracked changes beyond the committed rust-server updates.
Reviewer note
Rust/rust-server reviewers: @frol @farcaller @richardwhiuk @paladinzh @jacob-pro @dsteeley @Metaswitch
PR checklist
Summary by cubic
Ensures
rust-serverclient-only builds include pattern validation deps by addinglazy_staticandregexto theclientfeature when shared models emit pattern checks. Prevents missing-dependency build failures in projects without callbacks. Fixes #23920.lazy_staticandregexin the generatedclientfeature when models usepatternvalidation; keep callback-only deps under the callback branch.Cargo.tomlfiles.Written for commit 344276e. Summary will update on new commits.