-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [#5089] Preventing case changes in 'service fetch config' api calls
Make sure that `body` and `query_params` on service fetch configuration keep their original case type. In most cases we want to change the text case types of content, because the frontend and backend expect different case notations. For the service fetch `body` and `query_params` the case type schouldn't change, because this results in logic not being performed. Backport-Of: #5089
- Loading branch information
1 parent
2a34a56
commit ddc7ebf
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from djangorestframework_camel_case.render import CamelCaseJSONRenderer | ||
|
||
|
||
class ServiceFetchConfigurationRenderer(CamelCaseJSONRenderer): | ||
# The field body and query_params needs to be ignored, to prevent accidental snake_case to camelCase changes. | ||
# See github issue https://github.com/open-formulieren/open-forms/issues/5089 | ||
json_underscoreize = { | ||
"ignore_fields": ( | ||
"body", | ||
"query_params", | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters