Repository navigation
Conversation
There was a problem hiding this comment.
1 issue found across 91 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="samples/server/petstore/rust-axum/output/openapi-v3/src/models.rs">
<violation number="1" location="samples/server/petstore/rust-axum/output/openapi-v3/src/models.rs:2663">
P3: The match arms added to `ObjectUntypedProps::from_str` have inconsistent indentation (24/23 spaces instead of 20), so this regenerated sample will not match rustfmt output. Fix the template that emits these long one-line arms so the generated sample is properly indented.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| #[allow(clippy::redundant_clone)] | ||
| "required_untyped" => intermediate_rep.required_untyped.push(<crate::types::Object as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?), | ||
| #[allow(clippy::redundant_clone)] | ||
| "required_untyped" => intermediate_rep.required_untyped.push(<crate::types::Object as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?), |
There was a problem hiding this comment.
P3: The match arms added to ObjectUntypedProps::from_str have inconsistent indentation (24/23 spaces instead of 20), so this regenerated sample will not match rustfmt output. Fix the template that emits these long one-line arms so the generated sample is properly indented.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/server/petstore/rust-axum/output/openapi-v3/src/models.rs, line 2663:
<comment>The match arms added to `ObjectUntypedProps::from_str` have inconsistent indentation (24/23 spaces instead of 20), so this regenerated sample will not match rustfmt output. Fix the template that emits these long one-line arms so the generated sample is properly indented.</comment>
<file context>
@@ -2661,20 +2652,20 @@ impl std::str::FromStr for ObjectUntypedProps {
- #[allow(clippy::redundant_clone)]
- "required_untyped" => intermediate_rep.required_untyped.push(<crate::types::Object as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?),
+ #[allow(clippy::redundant_clone)]
+ "required_untyped" => intermediate_rep.required_untyped.push(<crate::types::Object as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?),
"required_untyped_nullable" => return std::result::Result::Err("Parsing a nullable type in this style is not supported in ObjectUntypedProps".to_string()),
- #[allow(clippy::redundant_clone)]
</file context>
| "required_untyped" => intermediate_rep.required_untyped.push(<crate::types::Object as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?), | |
| "required_untyped" => intermediate_rep.required_untyped.push(<crate::types::Object as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?), |
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="modules/openapi-generator/src/main/resources/rust-axum/models.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/rust-axum/models.mustache:1325">
P3: The UUID arm is emitted as one long line, leaving the generated sample unformatted beside the wrapped `FormatTest` arm. Wrap the expression in the template and regenerate the sample.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| {{/isUuid}} | ||
| {{#isUuid}} | ||
| #[allow(clippy::redundant_clone)] | ||
| "{{{baseName}}}" => intermediate_rep.{{{name}}}.push(<{{{dataType}}} as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?), |
There was a problem hiding this comment.
P3: The UUID arm is emitted as one long line, leaving the generated sample unformatted beside the wrapped FormatTest arm. Wrap the expression in the template and regenerate the sample.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At modules/openapi-generator/src/main/resources/rust-axum/models.mustache, line 1325:
<comment>The UUID arm is emitted as one long line, leaving the generated sample unformatted beside the wrapped `FormatTest` arm. Wrap the expression in the template and regenerate the sample.</comment>
<file context>
@@ -1317,7 +1317,13 @@ impl std::str::FromStr for {{{classname}}} {
+ {{/isUuid}}
+ {{#isUuid}}
+ #[allow(clippy::redundant_clone)]
+ "{{{baseName}}}" => intermediate_rep.{{{name}}}.push(<{{{dataType}}} as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?),
+ {{/isUuid}}
{{/isString}}
</file context>
|
It looks ok. Please help me merge this PR @wing328 . Thank you |
Ran integration test. Kindly ping @wing328 to review
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.
Summary by cubic
Fixes lint and formatting errors in the
rust-axumgenerator when building with Rust 1.100.x.val.to_string()instead of<String as std::str::FromStr>::from_str(val), eliminating theclippy::redundant_clonewarning caused by the new Never type. UUID fields keep theFromStrpath with the lint allow.Written for commit b0cfa43. Summary will update on new commits.