Fix inconsistent volume createdAt JSON encoding (#1556)

- Closes #1533 
- This PR aligns `volume list --format json` date
  encoding with volume inspect by using ISO-8601
  instead of the default numeric reference-date
  format.
This commit is contained in:
Raj
2026-05-15 00:59:28 -07:00
committed by GitHub
parent 615b5a6ffe
commit 16f5fc705f
2 changed files with 5 additions and 2 deletions
@@ -43,7 +43,8 @@ extension Application.VolumeCommand {
let volumes = try await ClientVolume.list()
if format == .json {
try Output.emit(Output.renderJSON(volumes))
let options = JSONOptions(dateEncodingStrategy: .iso8601)
try Output.emit(Output.renderJSON(volumes, options: options))
return
}
@@ -319,7 +319,9 @@ class TestCLIAnonymousVolumes: CLITest {
// Parse JSON to verify metadata
let data = output.data(using: .utf8)!
let volumes = try JSONDecoder().decode([Volume].self, from: data)
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601
let volumes = try decoder.decode([Volume].self, from: data)
let anonVolume = volumes.first { $0.name == volumeName }
#expect(anonVolume != nil, "should find anonymous volume in list")