Last active
April 18, 2021 05:17
-
-
Save KimSoungRyoul/58f40de5af76959644bc8340200948fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from drf_spectacular.utils import extend_schema_serializer | |
class UserSerializer(serializers.Serializer): | |
field_custom = serializers.SerializerMethodField(method_name="get_field_custom") | |
@extend_schema_field(OpenApiTypes.DATETIME) | |
def get_field_custom(self, object): | |
return '2021-03-06 20:54:00' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment