python-json-patch
python-json-patch copied to clipboard
Option for case-insensitiveness?
I'm not sure if I'm doing it wrong, but I have this question:
Say, I receive a patch to my API:
PATCH /news/123
[
{"op": "replace", "path": "/title", "value": "Example"}
]
But the target DB column is News.Title. The patch will fail because title !== Title.
Does the package have something that allows case-insensitiveness. Or alternatively, where could I place a mapping function that defines for example:
def mapping(self, path):
select = {
"/title": "Title,
"/authorname": "AuthorName"
}
return select.get(path, None)
I guess this question would be valid for any language.
Thanks!
Well, I implemented the mapping and it works so far.