Skip to content

Conversation

@dsteeley
Copy link
Contributor

@dsteeley dsteeley commented Feb 2, 2026

Update the sample example names for rust-server and rust-server-deprecated to resolve the warning about clashing binary names for the examples.

Also updated a feature flag to be client or server to resolve failing CI tests.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Namespace Rust example binaries by package to eliminate clashing names and clean up CI for rust-server and rust-server-deprecated. Updates templates, samples, READMEs, and the rust-server samples workflow.

  • Bug Fixes

    • Rename examples to "-client" and "-server" in rust-server and rust-server-deprecated Cargo templates; add explicit example paths; adjust header conversion cfgs in models to work for client/server; regenerate samples.
    • Update READMEs to use the new example names for run and HTTPS commands.
    • Fix CI workflow to iterate under output/, build examples with the new names, and run the CLI with the correct relative target path.
  • Migration

    • Use: cargo run --example -server or cargo run --example -client (instead of "server"/"client").
    • Example: cargo run --example openapi-v3-server.

Written for commit 5cbfc72. Summary will update on new commits.

@dsteeley dsteeley changed the title Rust server no clashing bins Rust-server no clashing example names Feb 2, 2026
@dsteeley dsteeley marked this pull request as ready for review February 4, 2026 17:32
Copy link

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

Choose a reason for hiding this comment

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

9 issues found across 45 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="samples/server/petstore/rust-server-deprecated/output/multipart-v3/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server-deprecated/output/multipart-v3/src/models.rs:140">
P2: Enabling client support for Vec<MultipartRequestObjectField> headers exposes a non-round‑trip serialization: items serialize using commas internally, but the Vec header logic joins/splits on commas, so parsing a serialized vector will mis-split items and fail.</violation>
</file>

<file name="samples/server/petstore/rust-server/output/no-example-v3/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server/output/no-example-v3/src/models.rs:125">
P2: Enabling the Vec<OpGetRequest> header parser for the client exposes a broken parsing implementation: the parser splits on every comma, but each OpGetRequest is itself encoded as "property,<value>". This causes valid multi-object headers (e.g., "property,a, property,b") to be split into invalid fragments and fail parsing with "Missing value while parsing OpGetRequest".</violation>
</file>

<file name="samples/server/petstore/rust-server-deprecated/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server-deprecated/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs:131">
P2: Enabling Vec<Animal> header conversion for the client feature exposes broken list serialization: each Animal string is already comma-delimited, but Vec<Animal> joins on ", " and the reverse conversion splits on ','—so object boundaries are lost and Animal::from_str fails on fragments. Client headers using arrays of models won’t deserialize.</violation>
</file>

<file name="samples/server/petstore/rust-server/output/rust-server-test/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server/output/rust-server-test/src/models.rs:141">
P2: Vec<DummyPutRequest> header parsing splits on commas, but each DummyPutRequest is itself comma‑separated key/value pairs. After this change enables the parser for the client feature, any header containing an array of DummyPutRequest values will be split into fragments and fail to parse.</violation>
</file>

<file name="samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs:134">
P2: Client-side header serialization for Vec<model> types is now enabled, but the array header format cannot be parsed back into models because each model’s Display output itself contains commas. Joining models with ", " and later splitting on commas breaks object boundaries, so headers generated by the client cannot be deserialized by the server/consumer.</violation>
</file>

<file name="samples/server/petstore/rust-server-deprecated/output/rust-server-test/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server-deprecated/output/rust-server-test/src/models.rs:138">
P2: Client-enabled header conversion for Vec<DummyPutRequest> splits on commas even though DummyPutRequest itself serializes with commas, so array header parsing will always fail for multi-field objects (fragments are passed to FromStr and trigger missing/unknown key errors).</violation>
</file>

<file name="modules/openapi-generator/src/main/resources/rust-server-deprecated/models.mustache">

<violation number="1" location="modules/openapi-generator/src/main/resources/rust-server-deprecated/models.mustache:582">
P2: Enabling client-side Vec<Struct> header parsing is broken because the parser splits on commas, but struct header serialization/deserialization already uses comma-separated key/value pairs. Any Vec of struct headers will fail to parse at runtime for clients.</violation>
</file>

<file name="samples/server/petstore/rust-server-deprecated/output/no-example-v3/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server-deprecated/output/no-example-v3/src/models.rs:123">
P2: Enabling the Vec<OpGetRequest> header parsing for the client feature exposes a parsing bug: the Vec deserializer splits on every comma, but each OpGetRequest uses commas internally (`property,<value>`). This fragments each element and causes `OpGetRequest::from_str` to error (“Missing value”), so multi-item headers fail to parse.</violation>
</file>

<file name="samples/server/petstore/rust-server/output/multipart-v3/src/models.rs">

<violation number="1" location="samples/server/petstore/rust-server/output/multipart-v3/src/models.rs:145">
P2: Client builds now enable header deserialization for Vec<MultipartRequestObjectField>, but the parser splits the header on commas and then feeds each token to MultipartRequestObjectField::from_str, which itself expects comma-separated key/value pairs. This destroys object structure and causes runtime parsing failures (e.g., “Missing value while parsing MultipartRequestObjectField”) when array headers are received.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Enabling client support for Vec headers exposes a non-round‑trip serialization: items serialize using commas internally, but the Vec header logic joins/splits on commas, so parsing a serialized vector will mis-split items and fail.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server-deprecated/output/multipart-v3/src/models.rs, line 140:

<comment>Enabling client support for Vec<MultipartRequestObjectField> headers exposes a non-round‑trip serialization: items serialize using commas internally, but the Vec header logic joins/splits on commas, so parsing a serialized vector will mis-split items and fail.</comment>

<file context>
@@ -137,7 +137,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipartRelatedRequest>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Enabling the Vec header parser for the client exposes a broken parsing implementation: the parser splits on every comma, but each OpGetRequest is itself encoded as "property,". This causes valid multi-object headers (e.g., "property,a, property,b") to be split into invalid fragments and fail parsing with "Missing value while parsing OpGetRequest".

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server/output/no-example-v3/src/models.rs, line 125:

<comment>Enabling the Vec<OpGetRequest> header parser for the client exposes a broken parsing implementation: the parser splits on every comma, but each OpGetRequest is itself encoded as "property,<value>". This causes valid multi-object headers (e.g., "property,a, property,b") to be split into invalid fragments and fail parsing with "Missing value while parsing OpGetRequest".</comment>

<file context>
@@ -122,7 +122,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<OpGetRequest>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Enabling Vec header conversion for the client feature exposes broken list serialization: each Animal string is already comma-delimited, but Vec joins on ", " and the reverse conversion splits on ','—so object boundaries are lost and Animal::from_str fails on fragments. Client headers using arrays of models won’t deserialize.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server-deprecated/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs, line 131:

<comment>Enabling Vec<Animal> header conversion for the client feature exposes broken list serialization: each Animal string is already comma-delimited, but Vec<Animal> joins on ", " and the reverse conversion splits on ','—so object boundaries are lost and Animal::from_str fails on fragments. Client headers using arrays of models won’t deserialize.</comment>

<file context>
@@ -128,7 +128,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<AdditionalPropertiesClass>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Vec header parsing splits on commas, but each DummyPutRequest is itself comma‑separated key/value pairs. After this change enables the parser for the client feature, any header containing an array of DummyPutRequest values will be split into fragments and fail to parse.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server/output/rust-server-test/src/models.rs, line 141:

<comment>Vec<DummyPutRequest> header parsing splits on commas, but each DummyPutRequest is itself comma‑separated key/value pairs. After this change enables the parser for the client feature, any header containing an array of DummyPutRequest values will be split into fragments and fail to parse.</comment>

<file context>
@@ -138,7 +138,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<ANullableContainer>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Client-side header serialization for Vec types is now enabled, but the array header format cannot be parsed back into models because each model’s Display output itself contains commas. Joining models with ", " and later splitting on commas breaks object boundaries, so headers generated by the client cannot be deserialized by the server/consumer.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs, line 134:

<comment>Client-side header serialization for Vec<model> types is now enabled, but the array header format cannot be parsed back into models because each model’s Display output itself contains commas. Joining models with ", " and later splitting on commas breaks object boundaries, so headers generated by the client cannot be deserialized by the server/consumer.</comment>

<file context>
@@ -131,7 +131,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<AdditionalPropertiesClass>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Client-enabled header conversion for Vec splits on commas even though DummyPutRequest itself serializes with commas, so array header parsing will always fail for multi-field objects (fragments are passed to FromStr and trigger missing/unknown key errors).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server-deprecated/output/rust-server-test/src/models.rs, line 138:

<comment>Client-enabled header conversion for Vec<DummyPutRequest> splits on commas even though DummyPutRequest itself serializes with commas, so array header parsing will always fail for multi-field objects (fragments are passed to FromStr and trigger missing/unknown key errors).</comment>

<file context>
@@ -135,7 +135,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<ANullableContainer>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Enabling client-side Vec header parsing is broken because the parser splits on commas, but struct header serialization/deserialization already uses comma-separated key/value pairs. Any Vec of struct headers will fail to parse at runtime for clients.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/rust-server-deprecated/models.mustache, line 582:

<comment>Enabling client-side Vec<Struct> header parsing is broken because the parser splits on commas, but struct header serialization/deserialization already uses comma-separated key/value pairs. Any Vec of struct headers will fail to parse at runtime for clients.</comment>

<file context>
@@ -579,7 +579,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<{{{classname}}}>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Enabling the Vec header parsing for the client feature exposes a parsing bug: the Vec deserializer splits on every comma, but each OpGetRequest uses commas internally (property,<value>). This fragments each element and causes OpGetRequest::from_str to error (“Missing value”), so multi-item headers fail to parse.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server-deprecated/output/no-example-v3/src/models.rs, line 123:

<comment>Enabling the Vec<OpGetRequest> header parsing for the client feature exposes a parsing bug: the Vec deserializer splits on every comma, but each OpGetRequest uses commas internally (`property,<value>`). This fragments each element and causes `OpGetRequest::from_str` to error (“Missing value”), so multi-item headers fail to parse.</comment>

<file context>
@@ -120,7 +120,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<OpGetRequest>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with Cubic

}

#[cfg(feature = "server")]
#[cfg(any(feature = "client", feature = "server"))]
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 4, 2026

Choose a reason for hiding this comment

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

P2: Client builds now enable header deserialization for Vec, but the parser splits the header on commas and then feeds each token to MultipartRequestObjectField::from_str, which itself expects comma-separated key/value pairs. This destroys object structure and causes runtime parsing failures (e.g., “Missing value while parsing MultipartRequestObjectField”) when array headers are received.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/server/petstore/rust-server/output/multipart-v3/src/models.rs, line 145:

<comment>Client builds now enable header deserialization for Vec<MultipartRequestObjectField>, but the parser splits the header on commas and then feeds each token to MultipartRequestObjectField::from_str, which itself expects comma-separated key/value pairs. This destroys object structure and causes runtime parsing failures (e.g., “Missing value while parsing MultipartRequestObjectField”) when array headers are received.</comment>

<file context>
@@ -142,7 +142,7 @@ impl std::convert::TryFrom<hyper::header::HeaderValue> for header::IntoHeaderVal
 }
 
-#[cfg(feature = "server")]
+#[cfg(any(feature = "client", feature = "server"))]
 impl std::convert::TryFrom<header::IntoHeaderValue<Vec<MultipartRelatedRequest>>> for hyper::header::HeaderValue {
     type Error = String;
</file context>
Fix with 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.

1 participant