Json encoding doesn't mutate

This commit is contained in:
Scott Yeager
2025-03-12 15:51:44 -07:00
parent 7807a8e736
commit 4988b241ef
2 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ pub fn (mut d Deployment) add_signature(twin u32, signature string) {
signature_type: 'sr25519'
}
}
pub fn (mut d Deployment) json_encode() string {
pub fn (d Deployment) json_encode() string {
return json.encode(d)
}
@@ -177,7 +177,7 @@ pub:
// return "{\\\"type\\\":\\\"${data.type_}\\\",\\\"name\\\":\\\"${data.name}\\\",\\\"projectName\\\":\\\"${data.project_name}\\\"}"
// }
pub fn (mut d DeploymentData) json_encode() string {
pub fn (d DeploymentData) json_encode() string {
return json.encode(d)
}

View File

@@ -132,7 +132,7 @@ pub fn (workload Workload) challenge_hash() []u8 {
return md5.sum(workload.challenge().bytes())
}
pub fn (mut w Workload) json_encode() string {
pub fn (w Workload) json_encode() string {
return '{"version":${w.version},"name":"${w.name}","type":"${w.type_}","data":${w.data},"metadata":"${w.metadata}","description":"${w.description}"}'
}