openapi-core/openapi_core/schema/schemas/util.py
2018-07-28 22:12:47 +01:00

14 lines
262 B
Python

"""OpenAPI core schemas util module"""
from distutils.util import strtobool
from json import dumps
def forcebool(val):
if isinstance(val, str):
val = strtobool(val)
return bool(val)
def dicthash(d):
return hash(dumps(d, sort_keys=True))