SolarEdgeTech/pyctuator

FastAPI: AttributeError: type object 'HealthSummary' has no attribute '__pydantic_model__'

uwohlfeil opened this issue · 4 comments

The current version of FastAPI (0.92.0) does not seem to work with the current Pyctuator (1.0.1).

I found a discussion about this in FastApi's GIT:
tiangolo/fastapi#3636

The cause of the problem seems to be a change in the Change tiangolo/fastapi#3576 .

The built-in dataclasses do not seem to be fully compatible with FastAPI when using enums.

As a test, I changed the dataclasses in health/health_provider.py to:

from pydantic.dataclasses import dataclass

And it works again.

Update:
The error does not occur in FastAPI version 0.88.0.

Thanks, will try to get to this soon.

This is the same issue as #87.
Fixed in #91

Version 1.0.2

@michaelyaakoby
Thank you very much for your work.
Just test it and it works.