Closed rbuffat closed 1 year ago
When generating an OpenAPI schema using python manage.py generateschema, the schema for the request to /api/token/ is generated as follows:
python manage.py generateschema
/api/token/
/api/token/: post: operationId: createMyTokenObtainPair description: '' parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MyTokenObtainPair' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MyTokenObtainPair' multipart/form-data: schema: $ref: '#/components/schemas/MyTokenObtainPair' responses: '201': content: application/json: schema: $ref: '#/components/schemas/MyTokenObtainPair' description: '' tags: - api
However, the return type of the function should be TokenRefresh and not MyTokenObtainPair (At least as far as I understand):
TokenRefresh
MyTokenObtainPair
/api/token/: post: operationId: createMyTokenObtainPair description: '' parameters: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MyTokenObtainPair' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MyTokenObtainPair' multipart/form-data: schema: $ref: '#/components/schemas/MyTokenObtainPair' responses: '201': content: application/json: schema: $ref: '#/components/schemas/TokenRefresh' description: '' tags: - api
This is unfortunate, as ideally, it would be great if it is possible to autogenerate client code from the generated schema.
Ups, I just noticed this issue is for the wrong project. Apologies if I caused any inconveniences.
When generating an OpenAPI schema using
python manage.py generateschema
, the schema for the request to/api/token/
is generated as follows:However, the return type of the function should be
TokenRefresh
and notMyTokenObtainPair
(At least as far as I understand):This is unfortunate, as ideally, it would be great if it is possible to autogenerate client code from the generated schema.