-
Notifications
You must be signed in to change notification settings - Fork 44
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
- Loading branch information
Showing
3 changed files
with
17 additions
and
3 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