Skip to content

Fix rust-server client feature deps for pattern validation#24023

Open
scarab-systems wants to merge 1 commit into
OpenAPITools:masterfrom
scarab-systems:scarab-systems/openapi-generator-23920-repair
Open

Fix rust-server client feature deps for pattern validation#24023
scarab-systems wants to merge 1 commit into
OpenAPITools:masterfrom
scarab-systems:scarab-systems/openapi-generator-23920-repair

Conversation

@scarab-systems

@scarab-systems scarab-systems commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #23920.

What changed

  • Adds lazy_static and regex to the generated rust-server client feature whenever generated models can emit pattern validation statics.
  • Keeps callback-only dependencies under the callback branch.
  • Adds a focused regression spec/test for pattern validation in generated shared models.
  • Regenerates the affected current rust-server sample Cargo manifests.

Why

rust-server shared models can emit lazy_static::lazy_static! and regex::Regex for schema pattern validation even when consumers build only the client feature. Previously, those dependencies were only added to the client feature 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.sh

The 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

  • Read the contribution guidelines.
  • Run the following full repo-wide build/sample/doc export sequence:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
  • Mentioned Rust/rust-server reviewers for the language-specific change.

Summary by cubic

Ensures rust-server client-only builds include pattern validation deps by adding lazy_static and regex to the client feature when shared models emit pattern checks. Prevents missing-dependency build failures in projects without callbacks. Fixes #23920.

  • Bug Fixes
    • Include lazy_static and regex in the generated client feature when models use pattern validation; keep callback-only deps under the callback branch.
    • Add a focused regression test to assert the client feature includes these deps when pattern statics are emitted.
    • Regenerate affected sample Cargo.toml files.

Written for commit 344276e. Summary will update on new commits.

Review in cubic

@scarab-systems scarab-systems marked this pull request as draft June 13, 2026 19:27

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Re-trigger cubic

@scarab-systems scarab-systems marked this pull request as ready for review June 13, 2026 19:43

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] rust-server: client feature missing lazy_static and regex deps when models use pattern validation

1 participant