Fix OpenAPI generation
This commit is contained in:
parent
0e3a77bc0e
commit
d9cfa167c6
21 changed files with 198 additions and 136 deletions
|
|
@ -307,7 +307,7 @@ class User(AbstractUser):
|
|||
|
||||
return groups
|
||||
|
||||
def full_username(self):
|
||||
def full_username(self) -> str:
|
||||
return "{}@{}".format(self.username, settings.FEDERATION_HOSTNAME)
|
||||
|
||||
def get_avatar(self):
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ from funkwhale_api.moderation import models as moderation_models
|
|||
from funkwhale_api.moderation import tasks as moderation_tasks
|
||||
from funkwhale_api.moderation import utils as moderation_utils
|
||||
|
||||
from drf_spectacular.utils import extend_schema_field
|
||||
from drf_spectacular.types import OpenApiTypes
|
||||
|
||||
from . import adapters
|
||||
from . import models
|
||||
from . import authentication as users_authentication
|
||||
|
|
@ -205,6 +208,7 @@ class UserReadSerializer(serializers.ModelSerializer):
|
|||
def get_permissions(self, o):
|
||||
return o.get_permissions()
|
||||
|
||||
@extend_schema_field(OpenApiTypes.STR)
|
||||
def get_full_username(self, o):
|
||||
if o.actor:
|
||||
return o.actor.full_username
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue