If you're stuck with `python jsondecoder omit fields`, here's a hacky but fun way:
Monkey-patch `json.decoder.scanstring` to bail early if the key matches your blacklist.
*Disclaimer*: This is cursed and might break things. But it *does* skip parsing entirely for unwanted keys.
```python
original_scanstring = json.decoder.scanstring
def patched_scanstring(*args, **kwargs):
# ... magic to check keys ...
return original_scanstring(*args, **kwargs)
json.decoder.scanstring = patched_scanstring
```
Use at your own risk.
Monkey-patch `json.decoder.scanstring` to bail early if the key matches your blacklist.
*Disclaimer*: This is cursed and might break things. But it *does* skip parsing entirely for unwanted keys.
```python
original_scanstring = json.decoder.scanstring
def patched_scanstring(*args, **kwargs):
# ... magic to check keys ...
return original_scanstring(*args, **kwargs)
json.decoder.scanstring = patched_scanstring
```
Use at your own risk.
