This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38
Problem
The Save JSON button calls to_json() directly. Vuetify field rules can show validation errors, but export is not gated on validation state. Empty required values are silently converted into defaults by dvalue().
Code references:
|
<v-btn block @click="to_json()"> |
|
{{ $t("message.save_json") }} |
|
// textarea -> list |
|
if (!this.value) return []; |
|
return this.value |
|
.trim() |
|
.split("\n") |
|
.map((v) => { |
|
try { |
|
return JSON.parse(v); |
|
} catch (e) { |
|
return v; |
|
} |
|
}); |
|
} |
|
} else if (["str", "int", "float"].includes(this.select_type)) { |
|
if (!this.value) { |
|
if (this.select_type == "str") return ""; |
|
else return 0; |
Relevant snippet:
if (!this.value) return [];
if (!this.value) {
if (this.select_type == "str") return "";
else return 0;
}
Impact
Users can export JSON even when required fields are empty or invalid. The exported file can contain [], "", or 0 values that were never intentionally supplied.
Suggested fix
Wrap the generated controls in a v-form, validate before to_json(), and avoid substituting empty required fields with default-looking values during export.
This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38
Problem
The Save JSON button calls
to_json()directly. Vuetify field rules can show validation errors, but export is not gated on validation state. Empty required values are silently converted into defaults bydvalue().Code references:
dpgui/src/components/dargs/DargsInput.vue
Lines 27 to 28 in e3c5b38
dpgui/src/components/dargs/DargsItem.vue
Lines 329 to 345 in e3c5b38
Relevant snippet:
Impact
Users can export JSON even when required fields are empty or invalid. The exported file can contain
[],"", or0values that were never intentionally supplied.Suggested fix
Wrap the generated controls in a
v-form, validate beforeto_json(), and avoid substituting empty required fields with default-looking values during export.