fix for base64 choices #204
This commit is contained in:
@ -76,7 +76,7 @@ class UndefinedType: # pragma no cover
|
|||||||
|
|
||||||
Undefined = UndefinedType()
|
Undefined = UndefinedType()
|
||||||
|
|
||||||
__version__ = "0.10.8"
|
__version__ = "0.10.9"
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"Integer",
|
"Integer",
|
||||||
"BigInteger",
|
"BigInteger",
|
||||||
|
|||||||
@ -251,9 +251,10 @@ def overwrite_binary_format(schema: Dict[str, Any], model: Type["Model"]) -> Non
|
|||||||
and model.Meta.model_fields[field_id].represent_as_base64_str
|
and model.Meta.model_fields[field_id].represent_as_base64_str
|
||||||
):
|
):
|
||||||
prop["format"] = "base64"
|
prop["format"] = "base64"
|
||||||
prop["enum"] = [
|
if prop.get("enum"):
|
||||||
base64.b64encode(choice).decode() for choice in prop["enum"]
|
prop["enum"] = [
|
||||||
]
|
base64.b64encode(choice).decode() for choice in prop.get("enum", [])
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def construct_modify_schema_function(fields_with_choices: List) -> SchemaExtraCallable:
|
def construct_modify_schema_function(fields_with_choices: List) -> SchemaExtraCallable:
|
||||||
|
|||||||
@ -7,7 +7,7 @@ typing_extensions>=3.7,<=3.7.4.3
|
|||||||
orjson
|
orjson
|
||||||
cryptography
|
cryptography
|
||||||
|
|
||||||
# Async database drivers
|
# Async database driversy
|
||||||
aiomysql
|
aiomysql
|
||||||
aiosqlite
|
aiosqlite
|
||||||
aiopg
|
aiopg
|
||||||
|
|||||||
Reference in New Issue
Block a user