-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Rust-server no clashing example names #22880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Rust-server no clashing example names #22880
Conversation
…g warnings about clashing example names
…e. Preventing warnings about clashing example names
There was a problem hiding this 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"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
| } | ||
|
|
||
| #[cfg(feature = "server")] | ||
| #[cfg(any(feature = "client", feature = "server"))] |
There was a problem hiding this comment.
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>
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
clientorserverto resolve failing CI tests.PR checklist
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.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)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
Migration
Written for commit 5cbfc72. Summary will update on new commits.