Hello,
I'm trying to use the new generateschema command from 3.10. However it seems this does not handle lazy strings correctly.
Using the UserSerializer right from the quickstart tutorial (ModelSerializer on django.contrib.auth.models.User) yields the following schema:
openapi: 3.0.2
info:
title: ''
version: TODO
paths:
/users/:
get:
operationId: ListUsers
parameters: []
responses:
'200':
content:
application/json:
schema:
required:
- username
properties:
url:
type: string
readOnly: true
username:
type: string
description: &id003 !!python/object/apply:django.utils.functional._lazy_proxy_unpickle
- &id001 !!python/name:django.utils.translation.ugettext ''
- !!python/tuple
- Required. 150 characters or fewer. Letters, digits and @/./+/-/_
only.
- {}
- &id002 !!python/name:builtins.str ''
(note the garbage in username.description)
Is this a bug or am I doing something wrong?
thanks,
chris