diff --git a/HISTORY.rst b/HISTORY.rst index 6a5fda56..a0d5432d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,7 +5,7 @@ History 6.2.1 (unreleased) ------------------ -- Nothing changed yet. +- Issues `#89 `_ & `#90 `_ possible breaking for ``FHIRAbstractModel.dict`` (if pydnatic specific extra argument has been provided) is neutralized.[nazrulworld] 6.2.0 (2022-01-01) diff --git a/appveyor.yml b/appveyor.yml index cd63104d..f457396c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -48,12 +48,6 @@ install: - ECHO "Installed SDKs:" - ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\"" - # Install Rust dependency - - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init -yv --default-toolchain stable --default-host x86_64-pc-windows-msvc - - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - - rustc -vV - - cargo -vV # Prepend newly installed Python to the PATH of this build (this cannot be # done from inside the powershell script as it would require to restart # the parent CMD process). diff --git a/fhir/resources/STU3/fhirabstractmodel.py b/fhir/resources/STU3/fhirabstractmodel.py index b552894b..45ea31df 100644 --- a/fhir/resources/STU3/fhirabstractmodel.py +++ b/fhir/resources/STU3/fhirabstractmodel.py @@ -403,7 +403,20 @@ def dict( by_alias: bool = True, exclude_none: bool = True, exclude_comments: bool = False, + **pydantic_extra ) -> OrderedDict: + """important! + there is no impact on ``pydantic_extra`` we keep it as backward compatibility. + @see issues https://github.com/nazrulworld/fhir.resources/issues/90 + & https://github.com/nazrulworld/fhir.resources/issues/89 + """ + if len(pydantic_extra) > 0: + logger.warning( + f"{self.__class__.__name__}.dict method accepts only" + "´by_alias´, ´exclude_none´, ´exclude_comments` as parameters" + " since version v6.2.0, any extra parameter is simply ignored. " + "You should not provide any extra argument." + ) return OrderedDict( self._fhir_iter( by_alias=by_alias, diff --git a/fhir/resources/fhirabstractmodel.py b/fhir/resources/fhirabstractmodel.py index 78b1a5cc..cb8bfe85 100644 --- a/fhir/resources/fhirabstractmodel.py +++ b/fhir/resources/fhirabstractmodel.py @@ -403,7 +403,20 @@ def dict( by_alias: bool = True, exclude_none: bool = True, exclude_comments: bool = False, + **pydantic_extra ) -> OrderedDict: + """important! + there is no impact on ``pydantic_extra`` we keep it as backward compatibility. + @see issues https://github.com/nazrulworld/fhir.resources/issues/90 + & https://github.com/nazrulworld/fhir.resources/issues/89 + """ + if len(pydantic_extra) > 0: + logger.warning( + f"{self.__class__.__name__}.dict method accepts only" + "´by_alias´, ´exclude_none´, ´exclude_comments` as parameters" + " since version v6.2.0, any extra parameter is simply ignored. " + "You should not provide any extra argument." + ) return OrderedDict( self._fhir_iter( by_alias=by_alias,