drf-spectacular Questions

1

I'm struggling to find a way to add a field description to my request body fields, they are picked up by the serializer definion just fine but I would like to add a description line to better expla...
Thirlage asked 4/5, 2023 at 9:0

2

Solved

when extending a new Token Authentication class from rest_framework_simplejwt.authentication.JWTAuthentication drf-spectacular swagger-ui authorize button disappears and there is no way to add toke...

1

could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. int:id) or annotating the para...
Paulettepauley asked 20/6, 2023 at 7:7

4

Solved

We have a bunch of api's with different versions in urls.py, eg api/v1 api/v2 api/v3 . We want to implement swagger with drf-spectacular, but we only want to expose api/v3 endpoints. Is there a w...
Aeniah asked 26/8, 2021 at 17:34

3

I am struggling to properly generate the schema for my custom pagination in django rest framework. I am using drf-spectacular for the schema generation. My custom pagination includes a total-pages ...

0

By default, when using drf-spectacular to generate the OpenAPI schema, the JSONField will be typed as object or array. However, I have a JSON Field which is validated against a JSON Schema and I'd ...
Acanthopterygian asked 29/11, 2022 at 21:45

1

Solved

After upgrading djangorestframework from djangorestframework==3.13.1 to djangorestframework==3.14.0 the code from rest_framework.serializers import NullBooleanField Throws AttributeError: module ...
Smalltime asked 23/9, 2022 at 6:26

2

I have generic ListAPIView with following list request function. Here category is a query parameter. I am trying to achieve such that the swagger ui also shows the query parameter in the swagger ui...

1

Solved

Using DRF's built-in way of documenting the API, I was able to write a docstring like the following and each action was documented by its corresponding line: """ list: The list actio...

1

Solved

I created a custom field named PictureField which creates thumbnails with uploaded images and I used it in my User model User model: class User(AbstractBaseUser): profile_image = PictureField(make...

1

Solved

Consider that I have a simple view as, # serializers.py class EmptyPayloadResponseSerializer(serializers.Serializer): detail = serializers.CharField() # views.py from rest_framework.views import...

1

I have a Django REST Framework project which uses a ModelViewSet to create APIs for a model containing a FileField. I've shared a full example of a Django project demonstrating this issue here. But...
Kinswoman asked 13/5, 2021 at 15:11
1

© 2022 - 2024 — McMap. All rights reserved.