Skip to content

Connecting Villages - v0.2.0

Latest
Compare
Choose a tag to compare
@mayureshagashe2105 mayureshagashe2105 released this 28 Jul 04:45
· 15 commits to main since this release
d06fe06

Release 0.2.0

Highlights

  • This release focuses on migrating the API to be compatible with the new Pydantic V2 engine, to get 20-30% improved performance.

Migration

  • Pydantic V2 deprecated the use of pydantic.json.ENCODER_BY_TYPES hence the API now uses custom json encoders provided as fastapi.encoders.jsonable_encoder.
  • Config class now contains all the .env variables as per Pydantic V2 requirements.
  • Now Pydantic Settings is an additional optional package (included in fastapi[all]). To use settings you should now import from pydantic_settings import BaseSettings instead of importing from pydantic directly.

Major Features and Improvements

  • @json_encoder wrapper
    • As hinted in the migration section, Pydantic V2 deprecated the use of pydantic.json.ENCODER_BY_TYPES hence to serialize bson.ObjectID to string datatype, desired methods can be wrapped by using this decorator with desired mappings.

API Endpoint

Connecting-Villages-API