source-academy / stories-backend

Backend of Source Academy extension for Stories support.
0 stars 0 forks source link

Fix updating of stories #85

Closed RichDom2185 closed 11 months ago

RichDom2185 commented 11 months ago

Closes #83. Closes #84.

This also results in the following behaviour change: now, when updating stories:

github-actions[bot] commented 11 months ago

Coverage Status

coverage: 48.571% (-1.2%) from 49.775% when pulling 8d828a5f84b772966647a5d81f52c646a59839b9 on fix-updating-of-stories into 4c6d3c32a0d3794000414e9c13ac4239cef0ed4d on main.

RichDom2185 commented 11 months ago

@YaleChen299 thoughts on this behaviour change?

Unfortunately, I don't think there's any other way we can change this short of setting up validation to enforce the requirement of all param fields in JSON, which comes at a cost of additional overhead when only updating a single field. But it may or may not be worth the trade-off for more standardised behaviour between nullable and non-nullable fields (we eliminate the case of "when not included in JSON params", thus the resulting behaviour will be consistent).