This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38
Problem
Integer inputs use the same numeric validation and serialization path as floats. The validator accepts any value that is not NaN, and export uses Number.parseFloat() for both int and float.
Code references:
|
:rules="[ |
|
...(!jdata.optional ? rules.required : []), |
|
...(['int', 'float'].includes(select_type) ? rules.number : []), |
|
]" |
|
} else if (["str", "int", "float"].includes(this.select_type)) { |
|
if (!this.value) { |
|
if (this.select_type == "str") return ""; |
|
else return 0; |
|
} |
|
if (!(this.select_type == "str")) { |
|
return Number.parseFloat(this.value); |
|
} |
Relevant snippet:
...(['int', 'float'].includes(select_type) ? rules.number : []),
if (!(this.select_type == "str")) {
return Number.parseFloat(this.value);
}
Impact
A field declared as int can accept and export a fractional value such as 1.5, producing invalid or semantically wrong input for downstream tools.
Suggested fix
Add a separate integer rule, for example based on Number.isInteger(Number(value)), and serialize int fields with an integer conversion after validation.
This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38
Problem
Integer inputs use the same numeric validation and serialization path as floats. The validator accepts any value that is not
NaN, and export usesNumber.parseFloat()for bothintandfloat.Code references:
dpgui/src/components/dargs/DargsItem.vue
Lines 136 to 139 in e3c5b38
dpgui/src/components/dargs/DargsItem.vue
Lines 342 to 349 in e3c5b38
Relevant snippet:
Impact
A field declared as
intcan accept and export a fractional value such as1.5, producing invalid or semantically wrong input for downstream tools.Suggested fix
Add a separate integer rule, for example based on
Number.isInteger(Number(value)), and serializeintfields with an integer conversion after validation.