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

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/9a3aa24c-3174-43ee-94b8-0014e24c8e03%40googlegroups.com.

Reply via email to