alecthomas / alecthomas/voluptuous
Allow ensuring a key does not exist in a dict
- Linguagem predominante
- Python
- Estrelas
- 1.9k
- Forks
- 237
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
I am using the library to validate JSON responses in my REST API, by doing something like:
```
resp = requests.get(...)
assert Schema({...}) in resp.json()
```
(I have couple of utility functions in there to make this work with pytest.)
It would be nice to have a construct that allowed to describe a key that may NOT exist in the response. Consider example.
```
resp = request.patch(...remove-a-key...)
assert Schema({
Missing('that-key'): None
}) in resp.json()
```
...or maybe it could be in `Schema.__init__` as `exclude=['field1', 'field2']` or something.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.