Skip to content

Conversation

@Floris272
Copy link
Contributor

@Floris272 Floris272 commented May 13, 2025

Fixes #576

Changes

  • Overrides the serializer_field_mapping for models.JSONField

  • inspired/copied from rest-framework-gis

  • rest-framework-gis is also the reason that setting the mapping in a mixin is not possible:

class JsonObjectFieldModelSerializerMixin:
    serializer_field_mapping = (
        serializers.ModelSerializer.serializer_field_mapping.copy()
    )
    serializer_field_mapping[models.JSONField] = JSONObjectField

@codecov-commenter
Copy link

codecov-commenter commented May 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.69%. Comparing base (1dcce4a) to head (deb305f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #584   +/-   ##
=======================================
  Coverage   94.68%   94.69%           
=======================================
  Files         147      148    +1     
  Lines        5133     5142    +9     
=======================================
+ Hits         4860     4869    +9     
  Misses        273      273           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Floris272 Floris272 marked this pull request as ready for review May 13, 2025 13:00
@Floris272 Floris272 force-pushed the issue/576-invalid-data-field-in-api-spec branch 2 times, most recently from e0e123c to 38bb3fc Compare May 13, 2025 13:33
@Floris272 Floris272 requested a review from stevenbal May 13, 2025 13:58
@Floris272 Floris272 force-pushed the issue/576-invalid-data-field-in-api-spec branch from 38bb3fc to deb305f Compare May 16, 2025 16:12
@Floris272 Floris272 merged commit 4d880ae into master May 16, 2025
25 checks passed
@Floris272 Floris272 deleted the issue/576-invalid-data-field-in-api-spec branch May 16, 2025 16:19
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

Successfully merging this pull request may close these issues.

ObjectRecord - data field in the OpenAPI spec is invalid - misses type property

4 participants