Skip to content

Allow type field on none polymorphic serializers #376

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

Merged
merged 1 commit into from
Nov 28, 2017

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Oct 11, 2017

Changes in #211 caused serializers with type field to fail, breaking backwards compatibility. This change fixes this by allowing type fields again on none polymorphic serializers.

@sliverc
Copy link
Member Author

sliverc commented Oct 11, 2017

For CI to run integrated #373 updated to current develop branch.

@codecov-io
Copy link

codecov-io commented Oct 12, 2017

Codecov Report

Merging #376 into develop will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #376      +/-   ##
===========================================
+ Coverage    93.05%   93.07%   +0.01%     
===========================================
  Files           51       52       +1     
  Lines         2665     2686      +21     
===========================================
+ Hits          2480     2500      +20     
- Misses         185      186       +1
Impacted Files Coverage Δ
setup.py 80% <ø> (ø) ⬆️
example/views.py 90.74% <ø> (ø) ⬆️
example/tests/conftest.py 100% <100%> (ø) ⬆️
rest_framework_json_api/parsers.py 97.14% <100%> (+0.17%) ⬆️
example/tests/test_model_viewsets.py 100% <100%> (ø) ⬆️
example/tests/test_performance.py 100% <100%> (ø) ⬆️
example/migrations/0004_auto_20171011_0631.py 100% <100%> (ø)
example/serializers.py 100% <100%> (ø) ⬆️
example/factories.py 97.1% <100%> (+0.22%) ⬆️
rest_framework_json_api/serializers.py 84.05% <0%> (-0.73%) ⬇️
... and 2 more

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 7b8e38e...f4aab7f. Read the comment docs.

@sliverc sliverc mentioned this pull request Nov 28, 2017
@mblayman
Copy link
Collaborator

@sliverc, thanks for going through all that extra effort for a relatively small change. 👍

@mblayman mblayman merged commit 9fa2e23 into django-json-api:develop Nov 28, 2017
sliverc added a commit to sliverc/django-rest-framework-json-api that referenced this pull request Oct 10, 2021
This support was added in django-json-api#376 but only for non polymorphic fields.

However as per specification [0] `type` must not be a field name and
therefore must be forbidden in DJA as well.

Some dependents might depend on being allowed to have a field
name `type` so deprecating it now and remove it in next major version.

[0] https://jsonapi.org/format/#document-resource-object-fields
@sliverc sliverc mentioned this pull request Oct 10, 2021
5 tasks
sliverc added a commit to sliverc/django-rest-framework-json-api that referenced this pull request Oct 10, 2021
This support was added in django-json-api#376 but only for non polymorphic fields.

However as per specification [0] `type` must not be a field name and
therefore must be forbidden in DJA as well.

Some dependents might depend on being allowed to have a field
name `type` so deprecating it now and remove it in next major version.

[0] https://jsonapi.org/format/#document-resource-object-fields
n2ygk pushed a commit that referenced this pull request Oct 11, 2021
This support was added in #376 but only for non polymorphic fields.

However as per specification [0] `type` must not be a field name and
therefore must be forbidden in DJA as well.

Some dependents might depend on being allowed to have a field
name `type` so deprecating it now and remove it in next major version.

[0] https://jsonapi.org/format/#document-resource-object-fields
@sliverc sliverc deleted the type_field_name branch December 28, 2021 18:52
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.

3 participants