It takes care of json serializing lazy translation strings by default. This was especially problematic for partial validation since errors contain lazy translations, but are part of the returned json. Serialization would break in that case. Doing so will also simplify the life of many other json returned (e.g. UISerializer probably).
It adds a default error_map to ResourceConfig so that classes inheriting ResourceConfig can reliably do:
class CustomResourceConfig(ResourceConfig):
error_map = {
**ResourceConfig.error_map,
CustomException: custom_handler
}
This PR fixes 2 things:
error_map
toResourceConfig
so that classes inheritingResourceConfig
can reliably do: