belso.schemas package
Submodules
belso.schemas.base module
belso.schemas.nested module
- class belso.schemas.nested.ArrayField(name, items_type=<class 'str'>, items_schema=None, description='', required=True)[source]
Bases:
Field
Field class for arrays of items.
- __init__(name, items_type=<class 'str'>, items_schema=None, description='', required=True)[source]
Initialize an array field.
Args
- param name:
the name of the field.
- type name:
str
items_type (Type, optional): the type of items in the array. Defaults to str.
items_schema (Type[Schema], optional): the schema of items in the array. Defaults to None.
description (str, optional): the description of the field. Defaults to an empty string.
required (bool, optional): whether the field is required. Defaults to True.
- class belso.schemas.nested.NestedField(name, schema, description='', required=True)[source]
Bases:
Field
Field class for nested schemas.
- __init__(name, schema, description='', required=True)[source]
Initialize a nested field.
Args
- param name:
the name of the field.
- type name:
str
- param schema:
the nested schema.
- type schema:
Type[Schema]
- param description:
the description of the field, defaults to an empty string.
- type description:
Optional[str]
- param required:
whether the field is required, defaults to True.
- type required:
Optional[bool]