Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/login username parameter isn't displayed by swagger-ui #41

Closed
stugots opened this issue Apr 29, 2015 · 5 comments
Closed

/login username parameter isn't displayed by swagger-ui #41

stugots opened this issue Apr 29, 2015 · 5 comments

Comments

@stugots
Copy link
Contributor

stugots commented Apr 29, 2015

This involves multiple packages, and I'm not sure where the issue lies. I'll start here. :-)

Using...

  • djoser from the git repository's master branch
  • django-rest-swagger 0.2.9
  • and the dist directory from swagger-ui's master branch..

I find that the "username" parameter for the /login endpoint isn't displayed in the swagger-ui documentation. "Password" is there, but username is not:

screen shot 2015-04-29 at 11 30 42 am

In djoser.serializers.UserLoginSerializer.Meta.fields, "username" is not listed as a field. The username is manually picked off through User.USERNAME_FIELD, but Django Rest Swagger can't find that reference and so isn't aware of the username parameter.

@haxoza
Copy link
Member

haxoza commented May 7, 2015

Thanks for submitting this issue. As far as I can see it's the same problem for /username/ endpoint. What's more this issue proves that more people use swagger. Maybe we should officially support it.

@konradhalas konradhalas added this to the 0.4.0 Release milestone Jun 7, 2015
@glothriel
Copy link

It's probably because username is not defined in serializer, as User.USERNAME_FIELD is used instead, which is correct. I don't see easy solution to this.

@haxoza
Copy link
Member

haxoza commented Aug 10, 2015

As far as I know after initial research some time ago there is an option to add doc strings to serializers that django-rest-swagger should be able to parse and generate appropriate JSON schema.

@jgirdner
Copy link

jgirdner commented Feb 6, 2016

Any idea on when there might be a fix for this?

@pszpetkowski
Copy link
Contributor

screenshot from 2017-10-03 12-47-31

DRF API docs correctly show the username parameter, so if the bug still shows up it's most probably on swagger side and there isn't much djoser can do here, therefore I'm going to close this issue, but if you believe that there is something more that I can do here, you are welcome to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants