forked from loafle/openapi-generator-original
Fix Rust generation for versions without minor or patch parts (#19946)
This fixes generation of a Rust library for OpenAPI specifications
where `info.version` was a single-digit number. This happened to for
[this](db005f2e55/openapi.yaml (L10)
)
specification. The fix for this issue is similar to the one in !17440.
This commit is contained in:
parent
e9c3c63732
commit
f576f05eb2
@ -422,9 +422,12 @@ public class RustClientCodegen extends AbstractRustCodegen implements CodegenCon
|
||||
content = content.trim().replace("v", "");
|
||||
content = content.replace("V", "");
|
||||
|
||||
// convert 5.2 to 5.2.0 for example
|
||||
String[] contents = content.split("[.]");
|
||||
if (contents.length == 2) {
|
||||
if (contents.length == 1) {
|
||||
// convert 5 to 5.0.0 for example
|
||||
content += ".0.0";
|
||||
} else if (contents.length == 2) {
|
||||
// convert 5.2 to 5.2.0 for example
|
||||
content += ".0";
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user