Upgrading pydantic 0.15 to 0.16
Breaking0.15 → 0.16.1Breaking2New3Fixed1
BreakingUpgrade verdict
2 breaking changes.
In plain terms
- Rename _schema to schema on fields.
- breaking change: refactor schema generation to be compatible with JSON Schema and OpenAPI specs.
Must act 2 items need code or config changes
What you must change
Breaking2
Rename _schema to schema on fields.
_schemaschemabreaking change: refactor schema generation to be compatible with JSON Schema and OpenAPI specs.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
field BaseSettings.Config.case_insensitive
- removed:
class Schema - removed:
constructor Schema(default, *, alias=…, title=…, choice_names=…, **extra) - removed:
method Field.schema(by_alias=…) - removed:
method Field.type_schema(by_alias) - changed:
constructor Field(*, name: str, type_: Type, class_validators: List[Validator], default: Any, required: bool, model_config: Any, alias: str=…, allow_none: bool=…, schema: Schema=…) → constructor Field(*, name: str, type_: Type, class_validators: List[Validator], default: Any, required: bool, model_config: Any, alias: str=…, allow_none: bool=…, schema=…)
- removed:
static method BaseModel.type_schema(by_alias) - added:
function inherit_validators(base_validators, validators)
- added:
class Schema - added:
constructor Schema(default, *, alias: str=…, title: str=…, description: str=…, gt: float=…, ge: float=…, lt: float=…, le: float=…, min_length: int=…, max_length: int=…, regex: str=…, **extra) - added:
function field_schema(field: Field, *, by_alias=…, model_name_map: Dict[Type[main.BaseModel], str], ref_prefix=…) -> Tuple[Dict[str, Any], Dict[str, Any]] - added:
function field_singleton_schema(field: Field, *, by_alias: bool, model_name_map: Dict[Type[main.BaseModel], str], schema_overrides=…, ref_prefix=…) -> Tuple[Dict[str, Any], Dict[str, Any]] - added:
function field_singleton_sub_fields_schema(sub_fields: Sequence[Field], *, by_alias: bool, model_name_map: Dict[Type[main.BaseModel], str], schema_overrides=…, ref_prefix=…) -> Tuple[Dict[str, Any], Dict[str, Any]] - added:
function field_type_schema(field: Field, *, by_alias: bool, model_name_map: Dict[Type[main.BaseModel], str], schema_overrides=…, ref_prefix=…) -> Tuple[Dict[str, Any], Dict[str, Any]] - added:
function get_annotation_from_schema(annotation, schema) - added:
function get_flat_models_from_field(field: Field) -> Set[Type[main.BaseModel]] - added:
function get_flat_models_from_fields(fields) -> Set[Type[main.BaseModel]] - added:
function get_flat_models_from_model(model: Type[main.BaseModel]) -> Set[Type[main.BaseModel]] - added:
function get_flat_models_from_models(models: Sequence[Type[main.BaseModel]]) -> Set[Type[main.BaseModel]] - added:
function get_long_model_name(model: Type[main.BaseModel]) - added:
function get_model_name_map(unique_models: Set[Type[main.BaseModel]]) -> Dict[Type[main.BaseModel], str] - added:
function model_process_schema(model: Type[main.BaseModel], *, by_alias=…, model_name_map: Dict[Type[main.BaseModel], str], ref_prefix=…) -> Tuple[Dict[str, Any], Dict[str, Any]] - added:
function model_schema(model: Type[main.BaseModel], by_alias=…, ref_prefix=…) -> Dict[str, Any] - added:
function model_type_schema(model: Type[main.BaseModel], *, by_alias: bool, model_name_map: Dict[Type[main.BaseModel], str], ref_prefix=…) - added:
function schema(models: Sequence[Type[main.BaseModel]], *, by_alias=…, title=…, description=…, ref_prefix=…) -> Dict
- added:
class JsonWrapper
- added:
function lenient_issubclass(cls, class_or_tuple)