-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #751 from pedro-psb/fix/type-regression-on-drf-spe…
…ctacular Fix Any serializer type regression breaking Ruby bindings (cherry picked from commit 4d8e8db)
- Loading branch information
1 parent
8f3f697
commit f19bbcd
Showing
4 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Fixed the JSONField specification so it doesn't break ruby bindings. | ||
See context [here](https://github.com/pulp/pulp_rpm/issues/3639). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from drf_spectacular.utils import extend_schema_field | ||
from drf_spectacular.types import OpenApiTypes | ||
from rest_framework import serializers | ||
|
||
|
||
@extend_schema_field(OpenApiTypes.OBJECT) | ||
class JSONObjectField(serializers.JSONField): | ||
"""A drf JSONField override to force openapi schema to use 'object' type. | ||
Not strictly correct, but we relied on that for a long time. | ||
See: https://github.com/tfranzel/drf-spectacular/issues/1095 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters