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

Fix UserWarning in console with MongoDsn type #10

Open
jag-k opened this issue Sep 20, 2024 · 0 comments
Open

Fix UserWarning in console with MongoDsn type #10

jag-k opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jag-k
Copy link
Owner

jag-k commented Sep 20, 2024

Warning in console:

/.../pydantic-settings-export/lib/python3.12/site-packages/pydantic/type_adapter.py:390: UserWarning: Pydantic serializer warnings:
  Expected `multi-host-url` but got `str` - serialized value may not be as expected
  return self.serializer.to_json(

Pydantic Model:

from pydantic import Field, MongoDsn
from pydantic_settings import BaseSettings


class AppSettings(BaseSettings):
    """Pydantic class for Ulla Bot Spawner settings."""

	mongo_uri: MongoDsn = Field("mongodb://localhost:27017/", description="MongoDB connection uri")
@jag-k jag-k added the bug Something isn't working label Sep 20, 2024
@jag-k jag-k added this to the v0.3.0 milestone Sep 20, 2024
@jag-k jag-k self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant