Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring: Update the Config from FastAPI/Pydantic used in our API Models #532

Open
1 task done
kairoaraujo opened this issue Feb 1, 2024 · 0 comments
Open
1 task done

Comments

@kairoaraujo
Copy link
Member

What do you want to share with us?

We currently use an outdated API from FastAPI/Pydantic to configure (or custom configuration) in our API data models.

Here is an example:

class Response(BaseModel):
data: Dict[str, Any]
message: str
class Config:
with open("tests/data_examples/config/settings.json") as f:
content = f.read()
example_settings = json.loads(content)
schema_extra = {
"example": {
"data": example_settings,
"message": "Current Settings",
}
}

We use a class Config, which is a the old https://docs.pydantic.dev/1.10/usage/model_config/#options

We should migrate all to the new config API https://docs.pydantic.dev/latest/api/config/#options

References

See the PR where we discuss it:

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant