forked from pulp/pulp_ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
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