prusa3d / Prusa-Firmware-Buddy

Firmware for the Original Prusa MINI, Original Prusa MK4 and the Original Prusa XL 3D printers by Prusa Research.
Other
1.15k stars 222 forks source link

[BFW-6065] [BUG] /api/v1/job GET response contains invalid JSON #4193

Open ysmilda opened 1 month ago

ysmilda commented 1 month ago

Printer model

Mini+

Firmware version

>= v5.0.0-alpha3

Upgrades and modifications

No response

Printing from...

PrusaLink

Describe the bug

When a job is present without stat the returned JSON response for a GET request to /api/v1/job is invalid. It contains a comma at the end of the object which should only be there if the message has stat.

https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/f5a498ab8d2a42341d0dbeb969b7ae047783e860/lib/WUI/link_content/basic_gets.cpp#L434-L438

Moving the JSON_COMMA macro from the end of line 434 to the start of line 436 should fix the message.

How to reproduce

No response

Expected behavior

No response

Files

No response

danopernis commented 4 weeks ago

Hello, thanks for the bug report and thanks for the pull request. This is indeed a bug, I am opening internal ticket to track it.

danopernis commented 4 weeks ago

Thanks for the contribution, this is scheduled for next 6.2.0 version

danopernis commented 2 weeks ago

@ysmilda I pushed this to the 6.2.0-alpha2 which was just released, in case you want to try it before final 6.2.0 is released.