umutbozkurt / django-rest-framework-mongoengine

Mongoengine support for Django Rest Framework
MIT License
617 stars 166 forks source link

Compatibility improvements #281

Closed skeletorXVI closed 2 years ago

skeletorXVI commented 3 years ago
  1. Improve compatibility with drf-yasg by adding ref_name attribute to the Meta classes generated in DocumentSerializer.build_nested_reference_field() and DocumentSerializer.build_nested_embedded_field(). This fixes a collection of bugs related to the serializer reference names being declared multiple times.

  2. Replace self.Meta.model with with self.get_model() in DocumentSerializer to simplify implementing polymorphic model support. Notes:

    • ComboReferenceField still uses self.Meta.model
    • This solution only works with serializer instances
    • This is not an implementation for polymorphic model serializers, just a stepping stone
codecov[bot] commented 3 years ago

Codecov Report

Merging #281 (f2cf2ff) into master (2ab11b3) will increase coverage by 0.06%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #281      +/-   ##
==========================================
+ Coverage   89.31%   89.38%   +0.06%     
==========================================
  Files           8        8              
  Lines         936      942       +6     
==========================================
+ Hits          836      842       +6     
  Misses        100      100              
Impacted Files Coverage Δ
rest_framework_mongoengine/serializers.py 93.75% <100.00%> (+0.10%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ab11b3...f2cf2ff. Read the comment docs.