-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Any serializer type regression breaking Ruby bindings
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
- Loading branch information
Showing
4 changed files
with
27 additions
and
12 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 JSONDictField(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